Package org.ccil.cowan.tagsoup
Class Schema
java.lang.Object
org.ccil.cowan.tagsoup.Schema
Abstract class representing a TSSL schema.
Actual TSSL schemas are compiled into concrete subclasses of this class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Add to or replace a character entity in this schema.getElementType
(String name) Get an ElementType by name.int
Get an entity value by name.Return the prefix of this schema.getURI()
Return the URI (namespace name) of this schema.void
Specify natural parent of an element in this schema.Get the root element of this schemavoid
Change the prefix of this schema.void
Change the URI (namespace name) of this schema.
-
Field Details
-
M_ANY
public static final int M_ANY- See Also:
-
M_EMPTY
public static final int M_EMPTY- See Also:
-
M_PCDATA
public static final int M_PCDATA- See Also:
-
M_ROOT
public static final int M_ROOT- See Also:
-
F_RESTART
public static final int F_RESTART- See Also:
-
F_CDATA
public static final int F_CDATA- See Also:
-
F_NOFORCE
public static final int F_NOFORCE- See Also:
-
-
Constructor Details
-
Schema
public Schema()
-
-
Method Details
-
elementType
Add or replace an element type for this schema.- Parameters:
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
-
rootElementType
Get the root element of this schema -
attribute
Add or replace a default attribute for an element type in this schema.- Parameters:
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
-
parent
Specify natural parent of an element in this schema.- Parameters:
name
- Name of the child elementparentName
- Name of the parent element
-
entity
Add to or replace a character entity in this schema.- Parameters:
name
- Name of the entityvalue
- Value of the entity
-
getElementType
Get an ElementType by name.- Parameters:
name
- Name (Qname) of the element type- Returns:
- The corresponding ElementType
-
getEntity
Get an entity value by name.- Parameters:
name
- Name of the entity- Returns:
- The corresponding character, or 0 if none
-
getURI
Return the URI (namespace name) of this schema. -
getPrefix
Return the prefix of this schema. -
setURI
Change the URI (namespace name) of this schema. -
setPrefix
Change the prefix of this schema.
-