Package org.apache.xerces.parsers
Class CachingParserPool.ShadowedGrammarPool
- java.lang.Object
-
- org.apache.xerces.util.XMLGrammarPoolImpl
-
- org.apache.xerces.parsers.CachingParserPool.ShadowedGrammarPool
-
- All Implemented Interfaces:
org.apache.xerces.xni.grammars.XMLGrammarPool
- Enclosing class:
- CachingParserPool
public static final class CachingParserPool.ShadowedGrammarPool extends XMLGrammarPoolImpl
Shadowed grammar pool. This class is predicated on the existence of a concrete implementation; so using our own doesn't seem to bad an idea.- Author:
- Andy Clark, IBM, Neil Graham, IBM
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.xerces.util.XMLGrammarPoolImpl
XMLGrammarPoolImpl.Entry
-
-
Field Summary
-
Fields inherited from class org.apache.xerces.util.XMLGrammarPoolImpl
fGrammarCount, fGrammars, fPoolIsLocked, TABLE_SIZE
-
-
Constructor Summary
Constructors Constructor Description ShadowedGrammarPool(org.apache.xerces.xni.grammars.XMLGrammarPool grammarPool)Constructs a shadowed grammar pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcacheGrammars(java.lang.String grammarType, org.apache.xerces.xni.grammars.Grammar[] grammars)Give the grammarPool the option of caching these grammars.booleancontainsGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc)Returns true if the grammar pool contains a grammar associated to the specified description.org.apache.xerces.xni.grammars.GrammargetGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc)Returns the grammar associated to the specified description.org.apache.xerces.xni.grammars.GrammarretrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription gDesc)Retrieve a particular grammar.org.apache.xerces.xni.grammars.Grammar[]retrieveInitialGrammarSet(java.lang.String grammarType)Retrieve the initial set of grammars for the validator to work with.-
Methods inherited from class org.apache.xerces.util.XMLGrammarPoolImpl
clear, equals, hashCode, lockPool, putGrammar, removeGrammar, unlockPool
-
-
-
-
Method Detail
-
retrieveInitialGrammarSet
public org.apache.xerces.xni.grammars.Grammar[] retrieveInitialGrammarSet(java.lang.String grammarType)
Retrieve the initial set of grammars for the validator to work with. REVISIT: does this need to be synchronized since it's just reading?- Specified by:
retrieveInitialGrammarSetin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
retrieveInitialGrammarSetin classXMLGrammarPoolImpl- Parameters:
grammarType- Type of the grammars to be retrieved.- Returns:
- The initial grammar set the validator may place in its "bucket"
-
retrieveGrammar
public org.apache.xerces.xni.grammars.Grammar retrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription gDesc)
Retrieve a particular grammar. REVISIT: does this need to be synchronized since it's just reading?- Specified by:
retrieveGrammarin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
retrieveGrammarin classXMLGrammarPoolImpl- Parameters:
gDesc- Description of the grammar to be retrieved- Returns:
- Grammar corresponding to gDesc, or null if none exists.
-
cacheGrammars
public void cacheGrammars(java.lang.String grammarType, org.apache.xerces.xni.grammars.Grammar[] grammars)Give the grammarPool the option of caching these grammars. This certainly must be synchronized.- Specified by:
cacheGrammarsin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
cacheGrammarsin classXMLGrammarPoolImpl- Parameters:
grammarType- The type of the grammars to be cached.grammars- The Grammars that may be cached (unordered, Grammars previously given to the validator may be included).
-
getGrammar
public org.apache.xerces.xni.grammars.Grammar getGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc)
Returns the grammar associated to the specified description.- Overrides:
getGrammarin classXMLGrammarPoolImpl- Parameters:
desc- The description of the grammar.
-
containsGrammar
public boolean containsGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc)
Returns true if the grammar pool contains a grammar associated to the specified description.- Overrides:
containsGrammarin classXMLGrammarPoolImpl- Parameters:
desc- The description of the grammar.
-
-