Modifier and Type | Class and Description |
---|---|
protected static class | XMLGrammarPoolImpl.
This class is a grammar pool entry. |
Modifier and Type | Field and Description |
---|---|
private static final boolean | |
protected int | |
protected XMLGrammarPoolImpl. | fGrammars
Grammars. |
protected boolean | |
protected static final int | TABLE_SIZE
Default size. |
Access | Constructor and Description |
---|---|
public | |
public | XMLGrammarPoolImpl(int initialCapacity)
Constructs a grammar pool with a specified number of buckets. |
Modifier and Type | Method and Description |
---|---|
public void | cacheGrammars(String
the type of the grammars being returned; grammarType, Grammar[] an array containing the set of grammars being
returned; order is not significant. grammars)Implements com. return the final set of grammars that the validator ended up with. |
public void | clear()
Implements com. Removes all grammars from the pool. |
public boolean | containsGrammar(XMLGrammarDescription
The Grammar Description. desc)Returns true if the grammar pool contains a grammar associated to the specified grammar description. |
public boolean | Returns: True if the grammars are equal, otherwise falseThe grammar description desc1, XMLGrammarDescription The grammar description of the grammar to be compared to desc2)This method checks whether two grammars are the same. |
public Grammar | getGrammar(XMLGrammarDescription
The Grammar Description. desc)Returns the grammar associated to the specified grammar description. |
public int | Returns: The hash code valueThe grammar description desc)Returns the hash code value for the given grammar description. |
public void | lockPool()
Implements com. Causes the XMLGrammarPool not to store any grammars when the cacheGrammars(String, Grammar[[]) method is called. |
public void | putGrammar(Grammar
The Grammar. grammar)Puts the specified grammar into the grammar pool and associates it to its root element name or its target namespace. |
public Grammar | Returns: The removed grammar.The Grammar Description. desc)Removes the grammar associated to the specified grammar description from the grammar pool and returns the removed grammar. |
public Grammar | retrieveGrammar(XMLGrammarDescription
The description of the Grammar being requested. desc)Implements com. This method requests that the application retrieve a grammar corresponding to the given GrammarIdentifier from its cache. |
public Grammar[] | retrieveInitialGrammarSet(String
the type of the grammar, from the
grammarType)com.sun.org.apache.xerces.internal.xni.grammars.Grammar interface.Implements com. retrieve the initial known set of grammars. |
public void | unlockPool()
Implements com. Allows the XMLGrammarPool to store grammars when its cacheGrammars(String, Grammar[]) method is called. |
DEBUG | back to summary |
---|---|
private static final boolean DEBUG |
fGrammarCount | back to summary |
---|---|
protected int fGrammarCount |
fGrammars | back to summary |
---|---|
protected XMLGrammarPoolImpl. Grammars. |
fPoolIsLocked | back to summary |
---|---|
protected boolean fPoolIsLocked |
TABLE_SIZE | back to summary |
---|---|
protected static final int TABLE_SIZE Default size. |
XMLGrammarPoolImpl | back to summary |
---|---|
public XMLGrammarPoolImpl() Constructs a grammar pool with a default number of buckets. |
XMLGrammarPoolImpl | back to summary |
---|---|
public XMLGrammarPoolImpl(int initialCapacity) Constructs a grammar pool with a specified number of buckets. |
cacheGrammars | back to summary |
---|---|
public void cacheGrammars(String grammarType, Grammar[] grammars) Implements com. Doc from com. return the final set of grammars that the validator ended up with. This method is called after the validation finishes. The application may then choose to cache some of the returned grammars. |
clear | back to summary |
---|---|
public void clear() Implements com. Doc from com. Removes all grammars from the pool. |
containsGrammar | back to summary |
---|---|
public boolean containsGrammar(XMLGrammarDescription desc) Returns true if the grammar pool contains a grammar associated to the specified grammar description. Currently, the root element name is used as the key for DTD grammars and the target namespace is used as the key for Schema grammars.
|
equals | back to summary |
---|---|
public boolean equals(XMLGrammarDescription desc1, XMLGrammarDescription desc2) This method checks whether two grammars are the same. Currently, we compare the root element names for DTD grammars and the target namespaces for Schema grammars. The application can override this behaviour and add its own logic.
|
getGrammar | back to summary |
---|---|
public Grammar getGrammar(XMLGrammarDescription desc) Returns the grammar associated to the specified grammar description. Currently, the root element name is used as the key for DTD grammars and the target namespace is used as the key for Schema grammars.
|
hashCode | back to summary |
---|---|
public int hashCode(XMLGrammarDescription desc) Returns the hash code value for the given grammar description.
|
lockPool | back to summary |
---|---|
public void lockPool() Implements com. Doc from com. Causes the XMLGrammarPool not to store any grammars when the cacheGrammars(String, Grammar[[]) method is called. |
putGrammar | back to summary |
---|---|
public void putGrammar(Grammar grammar) Puts the specified grammar into the grammar pool and associates it to its root element name or its target namespace.
|
removeGrammar | back to summary |
---|---|
public Grammar removeGrammar(XMLGrammarDescription desc) Removes the grammar associated to the specified grammar description from the grammar pool and returns the removed grammar. Currently, the root element name is used as the key for DTD grammars and the target namespace is used as the key for Schema grammars.
|
retrieveGrammar | back to summary |
---|---|
public Grammar retrieveGrammar(XMLGrammarDescription desc) Implements com. Doc from com. This method requests that the application retrieve a grammar corresponding to the given GrammarIdentifier from its cache. If it cannot do so it must return null; the parser will then call the EntityResolver. An application must not call its EntityResolver itself from this method; this may result in infinite recursions.
|
retrieveInitialGrammarSet | back to summary |
---|---|
public Grammar[] retrieveInitialGrammarSet(String grammarType) Implements com. Doc from com. retrieve the initial known set of grammars. this method is called by a validator before the validation starts. the application can provide an initial set of grammars available to the current validation attempt. |
unlockPool | back to summary |
---|---|
public void unlockPool() Implements com. Doc from com. Allows the XMLGrammarPool to store grammars when its cacheGrammars(String, Grammar[]) method is called. This is the default state of the object. |
Modifier and Type | Field and Description |
---|---|
public XMLGrammarDescription | |
public Grammar | |
public int | |
public XMLGrammarPoolImpl. |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
protected void |
desc | back to summary |
---|---|
public XMLGrammarDescription desc |
grammar | back to summary |
---|---|
public Grammar grammar |
hash | back to summary |
---|---|
public int hash |
next | back to summary |
---|---|
public XMLGrammarPoolImpl. |
Entry | back to summary |
---|---|
protected Entry(int hash, XMLGrammarDescription desc, Grammar grammar, XMLGrammarPoolImpl. |
clear | back to summary |
---|---|
protected void clear() |