XML for Java 2.0.0

com.ibm.xml.framework
Interface ElementDeclPool


public abstract interface ElementDeclPool

Version:
Revision: 40 1.6 src/com/ibm/xml/framework/ElementDeclPool.java, parser, xml4j2, xml4j2_0_0

Method Summary
 int addAttDef(int elementIndex, AttDef attDef)
          Create and populate an AttDef, and this function will add it, and return the new attDefIndex for it.
 int addContentSpecNode(ContentSpecNode csn)
           
 int addDefaultAttributes(int elementIndex, AttrPool attrPool, int firstAttrIndex, int lastAttrIndex)
           
 int addElement(int elementNameIndex)
          Add an element and return the elementIndex, given an elementNameIndex.
 int addElementDecl(ElementDecl decl)
          Add an ElementDecl.
 boolean addId(int idIndex, int elementNameIndex)
           
 void addIdRef(int idIndex, int elementNameIndex)
           
 void checkIdRefs()
           
 void checkNamespace(int elementIndex, int firstAttrIndex)
           
 int getAttDef(int elementNameIndex, int attrNameIndex)
          Returns an index into the StringPool of the attribute name
 int getAttDefaultType(int attDefIndex)
          Returns an int corresponding to the com.ibm.xml.framework.AttDef AttDefaultType constant.
 int getAttName(int attDefIndex)
          Returns an index into the StringPool of the attribute name
 int getAttType(int attDefIndex)
          Returns an int corresponding to the com.ibm.xml.framework.AttDef AttType constant.
 int getAttValue(int attDefIndex)
          Returns an index into the StringPool of the attribute value
 ContentModel getContentModel(int elementIndex)
          Return a ContentModel, for validation.
 int getContentSpec(int elementIndex)
          Return a contentSpecIndex which can be used by getContentSpecNode
 java.lang.String getContentSpecAsString(int elementIndex)
          Return a String representation of the content model for an elementIndex.
 void getContentSpecNode(int contentSpecIndex, ContentSpecNode csn)
          Given a contentSpecIndex and a reference to a ContentSpecNode, this function will fill in the public fields of the ContentSpecNode, which can be accessed via the input reference, after the call.
 java.lang.String getContentSpecNodeAsString(int contentSpecIndex)
          Return the content spec node as a String.
 int getContentSpecType(int elementIndex)
          Return an int corresponding to a CONTENTSPEC_* constant in ElementDecl
 int getElement(int elementNameIndex)
          Return an element index, given an element name index.
 int getElementName(int elementIndex)
          Return an index which can be used by StringPool#toString
 int getEnumeration(int attDefIndex)
          Returns an index into the StringPool's stringsInList.
 int getRootElement()
          Get the root element index.
 void reset(ParserState parserState)
          Reset this pool for use during the next invocation of the parser.
 ElementDeclPool resetOrCopy(ParserState parserState)
          Return a pool for use during the next invocation of the parser.
 void setContentModel(int elementIndex, ContentModel cm)
          Set a ContentModel, for validation.
 void setRootElement(int elementIndex)
          Set the root element
 

Method Detail

reset

public void reset(ParserState parserState)
Reset this pool for use during the next invocation of the parser.

resetOrCopy

public ElementDeclPool resetOrCopy(ParserState parserState)
Return a pool for use during the next invocation of the parser.

setRootElement

public void setRootElement(int elementIndex)
Set the root element

getRootElement

public int getRootElement()
Get the root element index.

getElement

public int getElement(int elementNameIndex)
Return an element index, given an element name index.

addElement

public int addElement(int elementNameIndex)
Add an element and return the elementIndex, given an elementNameIndex.

addElementDecl

public int addElementDecl(ElementDecl decl)
Add an ElementDecl. You must build up a tree of ContentSpecNodes using addContentSpecNode and set ElementDecl.contentSpec to, the return value of the root addContentSpecNode call.

getElementName

public int getElementName(int elementIndex)
Return an index which can be used by StringPool#toString

getContentSpecType

public int getContentSpecType(int elementIndex)
Return an int corresponding to a CONTENTSPEC_* constant in ElementDecl

getContentSpec

public int getContentSpec(int elementIndex)
Return a contentSpecIndex which can be used by getContentSpecNode

getContentSpecAsString

public java.lang.String getContentSpecAsString(int elementIndex)
Return a String representation of the content model for an elementIndex.

getContentModel

public ContentModel getContentModel(int elementIndex)
Return a ContentModel, for validation.

setContentModel

public void setContentModel(int elementIndex,
                            ContentModel cm)
Set a ContentModel, for validation.

addContentSpecNode

public int addContentSpecNode(ContentSpecNode csn)

getContentSpecNode

public void getContentSpecNode(int contentSpecIndex,
                               ContentSpecNode csn)
Given a contentSpecIndex and a reference to a ContentSpecNode, this function will fill in the public fields of the ContentSpecNode, which can be accessed via the input reference, after the call.

getContentSpecNodeAsString

public java.lang.String getContentSpecNodeAsString(int contentSpecIndex)
Return the content spec node as a String.

addAttDef

public int addAttDef(int elementIndex,
                     AttDef attDef)
              throws java.lang.Exception
Create and populate an AttDef, and this function will add it, and return the new attDefIndex for it.

getAttDef

public int getAttDef(int elementNameIndex,
                     int attrNameIndex)
Returns an index into the StringPool of the attribute name

getAttName

public int getAttName(int attDefIndex)
Returns an index into the StringPool of the attribute name

getAttValue

public int getAttValue(int attDefIndex)
Returns an index into the StringPool of the attribute value

getAttType

public int getAttType(int attDefIndex)
Returns an int corresponding to the com.ibm.xml.framework.AttDef AttType constant.

getAttDefaultType

public int getAttDefaultType(int attDefIndex)
Returns an int corresponding to the com.ibm.xml.framework.AttDef AttDefaultType constant.

getEnumeration

public int getEnumeration(int attDefIndex)
Returns an index into the StringPool's stringsInList. The StringPool#stringsInList will return an array of int values which can be turned into Strings using StringPool#toString.
See Also:
StringPool.stringsInList(int)

addDefaultAttributes

public int addDefaultAttributes(int elementIndex,
                                AttrPool attrPool,
                                int firstAttrIndex,
                                int lastAttrIndex)
                         throws java.lang.Exception

addId

public boolean addId(int idIndex,
                     int elementNameIndex)

addIdRef

public void addIdRef(int idIndex,
                     int elementNameIndex)

checkIdRefs

public void checkIdRefs()
                 throws java.lang.Exception

checkNamespace

public void checkNamespace(int elementIndex,
                           int firstAttrIndex)
                    throws java.lang.Exception

XML for Java 2.0.0