|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.impl.validation.XMLGrammarPoolImpl
Stores grammars in a pool associated to a specific key. This grammar pool implementation stores two types of grammars: those keyed by the root element name, and those keyed by the grammar's target namespace. This is for now, a very simple default implementation of the GrammarPool interface. As we move forward, this will become more function-rich and robust.
Field Summary | |
protected java.util.Hashtable |
fGrammars
Grammars associated with element root name. |
protected java.util.Hashtable |
fGrammarsNS
Grammars associated with namespaces. |
protected org.apache.xerces.xni.grammars.Grammar |
fNoNSGrammar
|
Constructor Summary | |
XMLGrammarPoolImpl()
Default constructor. |
Method Summary | |
void |
cacheGrammars(java.lang.String grammarType,
org.apache.xerces.xni.grammars.Grammar[] grammars)
|
boolean |
containsGrammar(java.lang.String rootElement)
Returns true if the grammar pool contains a grammar associated to the specified root element name. |
boolean |
containsGrammarNS(java.lang.String namespace)
Returns true if the grammar pool contains a grammar associated to the specified target namespace. |
org.apache.xerces.xni.grammars.Grammar |
getGrammar(java.lang.String rootElement)
Returns the grammar associated to the specified root element name. |
org.apache.xerces.xni.grammars.Grammar |
getGrammarNS(java.lang.String namespace)
Returns the grammar associated to the specified target namespace. |
org.apache.xerces.xni.grammars.Grammar[] |
getGrammars()
|
org.apache.xerces.xni.grammars.Grammar[] |
getGrammarsNS()
Returns all grammars associated with namespaces. |
void |
putGrammar(java.lang.String rootElement,
org.apache.xerces.xni.grammars.Grammar grammar)
Puts the specified grammar into the grammar pool and associate it to a root element name. |
void |
putGrammarNS(java.lang.String namespace,
org.apache.xerces.xni.grammars.Grammar grammar)
Puts the specified grammar into the grammar pool and associate it to a target namespace. |
org.apache.xerces.xni.grammars.Grammar |
removeGrammar(java.lang.String rootElement)
Removes the grammar associated to the specified root elememt name from the grammar pool and returns the removed grammar. |
org.apache.xerces.xni.grammars.Grammar |
removeGrammarNS(java.lang.String namespace)
Removes the grammar associated to the specified namespace from the grammar pool and returns the removed grammar. |
org.apache.xerces.xni.grammars.Grammar |
retrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc)
|
org.apache.xerces.xni.grammars.Grammar[] |
retrieveInitialGrammarSet(java.lang.String grammarType)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Hashtable fGrammars
protected java.util.Hashtable fGrammarsNS
protected org.apache.xerces.xni.grammars.Grammar fNoNSGrammar
Constructor Detail |
public XMLGrammarPoolImpl()
Method Detail |
public org.apache.xerces.xni.grammars.Grammar[] retrieveInitialGrammarSet(java.lang.String grammarType)
retrieveInitialGrammarSet
in interface org.apache.xerces.xni.grammars.XMLGrammarPool
public void cacheGrammars(java.lang.String grammarType, org.apache.xerces.xni.grammars.Grammar[] grammars)
cacheGrammars
in interface org.apache.xerces.xni.grammars.XMLGrammarPool
public org.apache.xerces.xni.grammars.Grammar retrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc)
retrieveGrammar
in interface org.apache.xerces.xni.grammars.XMLGrammarPool
public void putGrammar(java.lang.String rootElement, org.apache.xerces.xni.grammars.Grammar grammar)
rootElement
- Root element name.grammar
- The grammar.public void putGrammarNS(java.lang.String namespace, org.apache.xerces.xni.grammars.Grammar grammar)
namespace
- The grammar namespace.grammar
- The grammar.public org.apache.xerces.xni.grammars.Grammar getGrammar(java.lang.String rootElement)
rootElement
- Root element name.public org.apache.xerces.xni.grammars.Grammar getGrammarNS(java.lang.String namespace)
namespace
- Target namespace.public org.apache.xerces.xni.grammars.Grammar removeGrammar(java.lang.String rootElement)
rootElement
- Root element name.public org.apache.xerces.xni.grammars.Grammar removeGrammarNS(java.lang.String namespace)
namespace
- Target namespace.public boolean containsGrammar(java.lang.String rootElement)
rootElement
- Root element name.public boolean containsGrammarNS(java.lang.String namespace)
namespace
- Target namespace.public org.apache.xerces.xni.grammars.Grammar[] getGrammars()
public org.apache.xerces.xni.grammars.Grammar[] getGrammarsNS()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |