org.ccil.cowan.tagsoup
Class Schema
java.lang.Object
org.ccil.cowan.tagsoup.Schema
public abstract class Schema
extends java.lang.Object
Abstract class representing a TSSL schema.
Actual TSSL schemas are compiled into concrete subclasses of this class.
void | attribute(String elemName, String attrName, String type, String value) - Add or replace a default attribute for an element type in this schema.
|
void | elementType(String name, int model, int memberOf, int flags) - Add or replace an element type for this schema.
|
void | entity(String name, char value) - Add to or replace a character entity in this schema.
|
ElementType | getElementType(String name) - Get an ElementType by name.
|
char | getEntity(String name) - Get an entity value by name.
|
String | getPrefix() - Return the prefix of this schema.
|
String | getURI() - Return the URI (namespace name) of this schema.
|
void | parent(String name, String parentName) - Specify natural parent of an element in this schema.
|
void | setPrefix(String prefix) - Change the prefix of this schema.
|
void | setURI(String uri) - Change the URI (namespace name) of this schema.
|
F_CDATA
public static final int F_CDATA
F_NOFORCE
public static final int F_NOFORCE
F_RESTART
public static final int F_RESTART
M_ANY
public static final int M_ANY
M_EMPTY
public static final int M_EMPTY
M_PCDATA
public static final int M_PCDATA
M_ROOT
public static final int M_ROOT
attribute
public void attribute(String elemName,
String attrName,
String type,
String value)
Add or replace a default attribute for an element type in this schema.
elemName
- Name (Qname) of the element typeattrName
- Name (Qname) of the attributetype
- Type of the attributevalue
- Default value of the attribute; null if no default
elementType
public void elementType(String name,
int model,
int memberOf,
int flags)
Add or replace an element type for this schema.
name
- Name (Qname) of the elementmodel
- Models of the element's content as a vector of bitsmemberOf
- Models the element is a member of as a vector of bitsflags
- Flags for the element
entity
public void entity(String name,
char value)
Add to or replace a character entity in this schema.
name
- Name of the entityvalue
- Value of the entity
getElementType
public ElementType getElementType(String name)
Get an ElementType by name.
name
- Name (Qname) of the element type
- The corresponding ElementType
getEntity
public char getEntity(String name)
Get an entity value by name.
name
- Name of the entity
- The corresponding character, or 0 if none
getPrefix
public String getPrefix()
Return the prefix of this schema.
getURI
public String getURI()
Return the URI (namespace name) of this schema.
parent
public void parent(String name,
String parentName)
Specify natural parent of an element in this schema.
name
- Name of the child elementparentName
- Name of the parent element
setPrefix
public void setPrefix(String prefix)
Change the prefix of this schema.
setURI
public void setURI(String uri)
Change the URI (namespace name) of this schema.
Licence: Academic Free License 3.0 and/or GPL 2.0