|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.impl.dtd.AbstractDTDGrammar
A generic grammar for use in validating XML documents. The Grammar object stores the validation information in a compiled form. Specific subclasses extend this class and "populate" the grammar by compiling the specific syntax (DTD, Schema, etc) into the data structures used by this object.
Note: The AbstractDTDGrammar object is not useful as a generic grammar access or query object. In other words, you cannot round-trip specific grammar syntaxes with the compiled grammar information in the AbstractDTDGrammar object. You can create equivalent validation rules in your choice of grammar syntax but there is no guarantee that the input and output will be the same. Renamed from Grammar to AbstractDTDGrammar by neilg, 01/17/02, to reflect the fact that this is anything but a general-purpose grammar. REVISIT : shouldn't this class and DTDGrammar be combined?
Inner Class Summary | |
protected static class |
AbstractDTDGrammar.TupleHashtable
A simple Hashtable implementation that takes a tuple (int, String, String) as the key and a int as value. |
Field Summary | |
protected XMLAttributeDecl |
fAttributeDecl
Temporary Attribute decl. |
static int |
TOP_LEVEL_SCOPE
Top level scope (-1). |
Fields inherited from interface org.apache.xerces.xni.grammars.Grammar |
XML_DTD, XML_SCHEMA |
Constructor Summary | |
protected |
AbstractDTDGrammar(SymbolTable symbolTable)
Default constructor. |
Method Summary | |
protected int |
createAttributeDecl()
|
protected int |
createContentSpec()
|
protected int |
createElementDecl()
|
protected int |
createEntityDecl()
|
protected int |
createNotationDecl()
|
boolean |
getAttributeDecl(int attributeDeclIndex,
XMLAttributeDecl attributeDecl)
getAttributeDecl |
int |
getAttributeDeclIndex(int elementDeclIndex,
java.lang.String attributeDeclName)
getAttributeDeclIndex |
boolean |
getContentSpec(int contentSpecIndex,
XMLContentSpec contentSpec)
getContentSpec |
java.lang.String |
getContentSpecAsString(int elementDeclIndex)
getContentSpecAsString |
protected ContentModelValidator |
getElementContentModelValidator(int elementDeclIndex)
getElementContentModelValidator |
boolean |
getElementDecl(int elementDeclIndex,
XMLElementDecl elementDecl)
getElementDecl |
int |
getElementDeclIndex(org.apache.xerces.xni.QName elementDeclQName,
int scope)
getElementDeclIndex |
int |
getElementDeclIndex(java.lang.String elementDeclName,
int scope)
getElementDeclIndex |
boolean |
getEntityDecl(int entityDeclIndex,
XMLEntityDecl entityDecl)
getEntityDecl |
int |
getEntityDeclIndex(java.lang.String entityDeclName)
getEntityDeclIndex |
int |
getFirstAttributeDeclIndex(int elementDeclIndex)
getFirstAttributeDeclIndex |
int |
getFirstElementDeclIndex()
Returns the index of the first element declaration. |
int |
getFirstEntityDeclIndex()
getFirstEntityDeclIndex |
int |
getFirstNotationDeclIndex()
getFirstNotationDeclIndex |
java.lang.String |
getGrammarType()
|
int |
getNextAttributeDeclIndex(int attributeDeclIndex)
getNextAttributeDeclIndex |
int |
getNextElementDeclIndex(int elementDeclIndex)
Returns the next index of the element declaration following the specified element declaration. |
int |
getNextEntityDeclIndex(int elementDeclIndex)
getNextEntityDeclIndex |
int |
getNextNotationDeclIndex(int elementDeclIndex)
getNextNotationDeclIndex |
boolean |
getNotationDecl(int notationDeclIndex,
XMLNotationDecl notationDecl)
getNotationDecl |
int |
getNotationDeclIndex(java.lang.String notationDeclName)
getNotationDeclIndex |
SymbolTable |
getSymbolTable()
Returns the symbol table. |
java.lang.String |
getTargetNamespace()
Returns this grammar's target namespace. |
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 |
protected boolean |
isDTD()
|
boolean |
isEntityDeclared(java.lang.String name)
Query method to check if entity with this name was declared. |
boolean |
isEntityUnparsed(java.lang.String name)
Query method to check if entity is unparsed. |
abstract boolean |
isNamespaceAware()
Returns true if this grammar is namespace aware. |
void |
printAttributes(int elementDeclIndex)
|
void |
printElements()
|
protected void |
putElementNameMapping(org.apache.xerces.xni.QName name,
int scope,
int elementDeclIndex)
|
protected void |
setAttributeDecl(int elementDeclIndex,
int attributeDeclIndex,
XMLAttributeDecl attributeDecl)
|
protected void |
setContentSpec(int contentSpecIndex,
XMLContentSpec contentSpec)
|
protected void |
setContentSpecIndex(int elementDeclIndex,
int contentSpecIndex)
|
protected void |
setElementDecl(int elementDeclIndex,
XMLElementDecl elementDecl)
|
protected void |
setEntityDecl(int entityDeclIndex,
XMLEntityDecl entityDecl)
|
protected void |
setFirstAttributeDeclIndex(int elementDeclIndex,
int newFirstAttrIndex)
|
protected void |
setNotationDecl(int notationDeclIndex,
XMLNotationDecl notationDecl)
|
protected void |
setTargetNamespace(java.lang.String targetNamespace)
|
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 XMLAttributeDecl fAttributeDecl
Constructor Detail |
protected AbstractDTDGrammar(SymbolTable symbolTable)
Method Detail |
public java.lang.String getGrammarType()
getGrammarType
in interface org.apache.xerces.xni.grammars.Grammar
public abstract boolean isNamespaceAware()
public SymbolTable getSymbolTable()
public java.lang.String getTargetNamespace()
public int getFirstElementDeclIndex()
getNextElementDeclIndex(int)
,
getElementDecl(int, org.apache.xerces.impl.dtd.XMLElementDecl)
public int getNextElementDeclIndex(int elementDeclIndex)
elementDeclIndex
- The element declaration index.public int getElementDeclIndex(java.lang.String elementDeclName, int scope)
elementDeclName
- scope
- public int getElementDeclIndex(org.apache.xerces.xni.QName elementDeclQName, int scope)
elementDeclQName
- scope
- 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 int getAttributeDeclIndex(int elementDeclIndex, java.lang.String attributeDeclName)
elementDeclIndex
- attributeDeclName
- 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 int getFirstEntityDeclIndex()
public int getNextEntityDeclIndex(int elementDeclIndex)
elementDeclIndex
- public int getEntityDeclIndex(java.lang.String entityDeclName)
entityDeclName
- public boolean getEntityDecl(int entityDeclIndex, XMLEntityDecl entityDecl)
entityDeclIndex
- entityDecl
- public int getFirstNotationDeclIndex()
public int getNextNotationDeclIndex(int elementDeclIndex)
elementDeclIndex
- public int getNotationDeclIndex(java.lang.String notationDeclName)
notationDeclName
- public boolean getNotationDecl(int notationDeclIndex, XMLNotationDecl notationDecl)
notationDeclIndex
- notationDecl
- public boolean getContentSpec(int contentSpecIndex, XMLContentSpec contentSpec)
contentSpecIndex
- contentSpec
- public java.lang.String getContentSpecAsString(int elementDeclIndex)
elementDeclIndex
- public void printElements()
public void printAttributes(int elementDeclIndex)
protected ContentModelValidator getElementContentModelValidator(int elementDeclIndex)
elementDeclIndex
- protected int createElementDecl()
protected void setElementDecl(int elementDeclIndex, XMLElementDecl elementDecl)
protected void putElementNameMapping(org.apache.xerces.xni.QName name, int scope, int elementDeclIndex)
protected void setFirstAttributeDeclIndex(int elementDeclIndex, int newFirstAttrIndex)
protected void setContentSpecIndex(int elementDeclIndex, int contentSpecIndex)
protected int createAttributeDecl()
protected void setAttributeDecl(int elementDeclIndex, int attributeDeclIndex, XMLAttributeDecl attributeDecl)
protected int createContentSpec()
protected void setContentSpec(int contentSpecIndex, XMLContentSpec contentSpec)
protected int createEntityDecl()
protected void setEntityDecl(int entityDeclIndex, XMLEntityDecl entityDecl)
protected int createNotationDecl()
protected void setNotationDecl(int notationDeclIndex, XMLNotationDecl notationDecl)
protected void setTargetNamespace(java.lang.String targetNamespace)
protected boolean isDTD()
public boolean isEntityDeclared(java.lang.String name)
EntityState
isEntityDeclared
in interface EntityState
org.apache.xerces.impl.validation.EntityState
name
- public boolean isEntityUnparsed(java.lang.String name)
EntityState
isEntityUnparsed
in interface EntityState
org.apache.xerces.impl.validation.EntityState
name
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |