org.ccil.cowan.tagsoup

Class Schema

public abstract class Schema extends Object

Abstract class representing a TSSL schema. Actual TSSL schemas are compiled into concrete subclasses of this class.
Field Summary
static intF_CDATA
static intF_NOFORCE
static intF_RESTART
static intM_ANY
static intM_EMPTY
static intM_PCDATA
static intM_ROOT
Method Summary
voidattribute(String elemName, String attrName, String type, String value)
Add or replace a default attribute for an element type in this schema.
voidelementType(String name, int model, int memberOf, int flags)
Add or replace an element type for this schema.
voidentity(String name, char value)
Add to or replace a character entity in this schema.
ElementTypegetElementType(String name)
Get an ElementType by name.
chargetEntity(String name)
Get an entity value by name.
StringgetPrefix()
Return the prefix of this schema.
StringgetURI()
Return the URI (namespace name) of this schema.
voidparent(String name, String parentName)
Specify natural parent of an element in this schema.
voidsetPrefix(String prefix)
Change the prefix of this schema.
voidsetURI(String uri)
Change the URI (namespace name) of this schema.

Field Detail

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

Method Detail

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.

Parameters: elemName Name (Qname) of the element type attrName Name (Qname) of the attribute type Type of the attribute value 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.

Parameters: name Name (Qname) of the element model Models of the element's content as a vector of bits memberOf Models the element is a member of as a vector of bits flags Flags for the element

entity

public void entity(String name, char value)
Add to or replace a character entity in this schema.

Parameters: name Name of the entity value Value of the entity

getElementType

public ElementType getElementType(String name)
Get an ElementType by name.

Parameters: name Name (Qname) of the element type

Returns: The corresponding ElementType

getEntity

public char getEntity(String name)
Get an entity value by name.

Parameters: name Name of the entity

Returns: 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.

Parameters: name Name of the child element parentName 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