|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.stream.dtd.nonvalidating.DTDGrammar
public class DTDGrammar
A DTD grammar. This class implements the XNI handler interfaces for DTD information so that it can build the approprate validation structures automatically from the callbacks.
Nested Class Summary | |
---|---|
protected static class |
DTDGrammar.QNameHashtable
A simple Hashtable implementation that takes a tuple (String, String) as the key and a int as value. |
Field Summary | |
---|---|
protected XMLAttributeDecl |
fAttributeDecl
Temporary Attribute decl. |
protected int |
fCurrentAttributeIndex
Current attribute index. |
protected int |
fCurrentElementIndex
Current element index. |
protected org.apache.xerces.xni.parser.XMLDTDContentModelSource |
fDTDContentModelSource
|
protected org.apache.xerces.xni.parser.XMLDTDSource |
fDTDSource
|
protected boolean |
fReadingExternalDTD
fReadingExternalDTD |
static int |
TOP_LEVEL_SCOPE
Top level scope (-1). |
Constructor Summary | |
---|---|
DTDGrammar(org.apache.xerces.util.SymbolTable symbolTable)
Default constructor. |
Method Summary | |
---|---|
void |
attributeDecl(java.lang.String elementName,
java.lang.String attributeName,
java.lang.String type,
java.lang.String[] enumeration,
java.lang.String defaultType,
org.apache.xerces.xni.XMLString defaultValue,
org.apache.xerces.xni.XMLString nonNormalizedDefaultValue,
org.apache.xerces.xni.Augmentations augs)
An attribute declaration. |
protected int |
createAttributeDecl()
|
protected int |
createElementDecl()
|
void |
elementDecl(java.lang.String name,
java.lang.String contentModel,
org.apache.xerces.xni.Augmentations augs)
An element declaration. |
void |
endDTD(org.apache.xerces.xni.Augmentations augs)
|
boolean |
getAttributeDecl(int attributeDeclIndex,
XMLAttributeDecl attributeDecl)
getAttributeDecl |
int |
getAttributeDeclIndex(int elementDeclIndex,
java.lang.String attributeDeclName)
|
short |
getContentSpecType(int elementIndex)
make separate function for getting contentSpecType of element. |
boolean |
getElementDecl(int elementDeclIndex,
XMLElementDecl elementDecl)
getElementDecl |
int |
getElementDeclIndex(org.apache.xerces.xni.QName elementDeclQName)
Returns the element decl index. |
int |
getElementDeclIndex(java.lang.String elementDeclName)
getElementDeclIndex |
int |
getFirstAttributeDeclIndex(int elementDeclIndex)
getFirstAttributeDeclIndex |
int |
getFirstElementDeclIndex()
Returns the index of the first element declaration. |
int |
getNextAttributeDeclIndex(int attributeDeclIndex)
getNextAttributeDeclIndex |
int |
getNextElementDeclIndex(int elementDeclIndex)
Returns the next index of the element declaration following the specified element declaration. |
java.util.List |
getNotationDecls()
|
org.apache.xerces.util.SymbolTable |
getSymbolTable()
Returns the symbol table. |
boolean |
isCDATAAttribute(org.apache.xerces.xni.QName elName,
org.apache.xerces.xni.QName atName)
Returns whether the given attribute is of type CDATA or not |
void |
notationDecl(java.lang.String name,
org.apache.xerces.xni.XMLResourceIdentifier identifier,
org.apache.xerces.xni.Augmentations augs)
|
void |
printAttributes(int elementDeclIndex)
|
void |
printElements()
|
protected void |
setAttributeDecl(int elementDeclIndex,
int attributeDeclIndex,
XMLAttributeDecl attributeDecl)
|
protected void |
setElementDecl(int elementDeclIndex,
XMLElementDecl elementDecl)
|
protected void |
setFirstAttributeDeclIndex(int elementDeclIndex,
int newFirstAttrIndex)
|
void |
startDTD(org.apache.xerces.xni.XMLLocator locator,
org.apache.xerces.xni.Augmentations augs)
The start of the DTD. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TOP_LEVEL_SCOPE
protected org.apache.xerces.xni.parser.XMLDTDSource fDTDSource
protected org.apache.xerces.xni.parser.XMLDTDContentModelSource fDTDContentModelSource
protected int fCurrentElementIndex
protected int fCurrentAttributeIndex
protected boolean fReadingExternalDTD
protected XMLAttributeDecl fAttributeDecl
Constructor Detail |
---|
public DTDGrammar(org.apache.xerces.util.SymbolTable symbolTable)
Method Detail |
---|
public int getAttributeDeclIndex(int elementDeclIndex, java.lang.String attributeDeclName)
public void startDTD(org.apache.xerces.xni.XMLLocator locator, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
locator
- The document locator, or null if the document
location cannot be reported during the parsing of
the document DTD. However, it is strongly
recommended that a locator be supplied that can
at least report the base system identifier of the
DTD.augs
- Additional information that may include infoset
augmentations.
org.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void elementDecl(java.lang.String name, java.lang.String contentModel, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
name
- The name of the element.contentModel
- The element content model.augs
- Additional information that may include infoset
augmentations.
org.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void attributeDecl(java.lang.String elementName, java.lang.String attributeName, java.lang.String type, java.lang.String[] enumeration, java.lang.String defaultType, org.apache.xerces.xni.XMLString defaultValue, org.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
elementName
- The name of the element that this attribute
is associated with.attributeName
- The name of the attribute.type
- The attribute type. This value will be one of
the following: "CDATA", "ENTITY", "ENTITIES",
"ENUMERATION", "ID", "IDREF", "IDREFS",
"NMTOKEN", "NMTOKENS", or "NOTATION".enumeration
- If the type has the value "ENUMERATION", this
array holds the allowed attribute values;
otherwise, this array is null.defaultType
- The attribute default type. This value will be
one of the following: "#FIXED", "#IMPLIED",
"#REQUIRED", or null.defaultValue
- The attribute default value, or null if no
default value is specified.nonNormalizedDefaultValue
- The attribute default value with no normalization
performed, or null if no default value is specified.augs
- Additional information that may include infoset
augmentations.
org.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public org.apache.xerces.util.SymbolTable getSymbolTable()
public int getFirstElementDeclIndex()
getNextElementDeclIndex(int)
,
getElementDecl(int, com.sun.xml.stream.dtd.nonvalidating.XMLElementDecl)
public int getNextElementDeclIndex(int elementDeclIndex)
elementDeclIndex
- The element declaration index.public int getElementDeclIndex(java.lang.String elementDeclName)
elementDeclName
-
public int getElementDeclIndex(org.apache.xerces.xni.QName elementDeclQName)
elementDeclQName
- qualilfied name of the elementpublic short getContentSpecType(int elementIndex)
public boolean getElementDecl(int elementDeclIndex, XMLElementDecl elementDecl)
elementDeclIndex
- elementDecl
- The values of this structure are set by this call.
public int getFirstAttributeDeclIndex(int elementDeclIndex)
elementDeclIndex
-
public int getNextAttributeDeclIndex(int attributeDeclIndex)
attributeDeclIndex
-
public boolean getAttributeDecl(int attributeDeclIndex, XMLAttributeDecl attributeDecl)
attributeDeclIndex
- attributeDecl
- The values of this structure are set by this call.
public boolean isCDATAAttribute(org.apache.xerces.xni.QName elName, org.apache.xerces.xni.QName atName)
elName
- The element name.atName
- The attribute name.
public void printElements()
public void printAttributes(int elementDeclIndex)
protected int createElementDecl()
protected void setElementDecl(int elementDeclIndex, XMLElementDecl elementDecl)
protected void setFirstAttributeDeclIndex(int elementDeclIndex, int newFirstAttrIndex)
protected int createAttributeDecl()
protected void setAttributeDecl(int elementDeclIndex, int attributeDeclIndex, XMLAttributeDecl attributeDecl)
public void notationDecl(java.lang.String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIException
public java.util.List getNotationDecls()
public void endDTD(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |