org.ccil.cowan.tagsoup
Class Schema

java.lang.Object
  extended by 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.


Field Summary
static int F_CDATA
           
static int F_NOFORCE
           
static int F_RESTART
           
static int M_ANY
           
static int M_EMPTY
           
static int M_PCDATA
           
static int M_ROOT
           
 
Constructor Summary
Schema()
           
 
Method Summary
 void attribute(java.lang.String elemName, java.lang.String attrName, java.lang.String type, java.lang.String value)
          Add or replace a default attribute for an element type in this schema.
 void elementType(java.lang.String name, int model, int memberOf, int flags)
          Add or replace an element type for this schema.
 void entity(java.lang.String name, char value)
          Add to or replace a character entity in this schema.
 ElementType getElementType(java.lang.String name)
          Get an ElementType by name.
 char getEntity(java.lang.String name)
          Get an entity value by name.
 java.lang.String getPrefix()
          Return the prefix of this schema.
 java.lang.String getURI()
          Return the URI (namespace name) of this schema.
 void parent(java.lang.String name, java.lang.String parentName)
          Specify natural parent of an element in this schema.
 void setPrefix(java.lang.String prefix)
          Change the prefix of this schema.
 void setURI(java.lang.String uri)
          Change the URI (namespace name) of this schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

M_ANY

public static final int M_ANY
See Also:
Constant Field Values

M_EMPTY

public static final int M_EMPTY
See Also:
Constant Field Values

M_PCDATA

public static final int M_PCDATA
See Also:
Constant Field Values

M_ROOT

public static final int M_ROOT
See Also:
Constant Field Values

F_RESTART

public static final int F_RESTART
See Also:
Constant Field Values

F_CDATA

public static final int F_CDATA
See Also:
Constant Field Values

F_NOFORCE

public static final int F_NOFORCE
See Also:
Constant Field Values
Constructor Detail

Schema

public Schema()
Method Detail

elementType

public void elementType(java.lang.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

attribute

public void attribute(java.lang.String elemName,
                      java.lang.String attrName,
                      java.lang.String type,
                      java.lang.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

parent

public void parent(java.lang.String name,
                   java.lang.String parentName)
Specify natural parent of an element in this schema.

Parameters:
name - Name of the child element
parentName - Name of the parent element

entity

public void entity(java.lang.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(java.lang.String name)
Get an ElementType by name.

Parameters:
name - Name (Qname) of the element type
Returns:
The corresponding ElementType

getEntity

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

Parameters:
name - Name of the entity
Returns:
The corresponding character, or 0 if none

getURI

public java.lang.String getURI()
Return the URI (namespace name) of this schema.


getPrefix

public java.lang.String getPrefix()
Return the prefix of this schema.


setURI

public void setURI(java.lang.String uri)
Change the URI (namespace name) of this schema.


setPrefix

public void setPrefix(java.lang.String prefix)
Change the prefix of this schema.



Licence: Academic Free License 3.0 and/or GPL 2.0