Package org.apache.xerces.parsers
Class CachingParserPool.SynchronizedGrammarPool
java.lang.Object
org.apache.xerces.parsers.CachingParserPool.SynchronizedGrammarPool
- All Implemented Interfaces:
org.apache.xerces.xni.grammars.XMLGrammarPool
- Enclosing class:
CachingParserPool
public static final class CachingParserPool.SynchronizedGrammarPool
extends Object
implements org.apache.xerces.xni.grammars.XMLGrammarPool
Synchronized grammar pool.
- Author:
- Andy Clark, IBM
-
Constructor Summary
ConstructorsConstructorDescriptionSynchronizedGrammarPool(org.apache.xerces.xni.grammars.XMLGrammarPool grammarPool) Constructs a synchronized grammar pool. -
Method Summary
Modifier and TypeMethodDescriptionvoidcacheGrammars(String grammarType, org.apache.xerces.xni.grammars.Grammar[] grammars) return the final set of grammars that the validator ended up with.voidclear()clear the grammar poolvoidlockPool()lock the grammar poolorg.apache.xerces.xni.grammars.GrammarretrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription gDesc) This method requests that the application retrieve a grammar corresponding to the given GrammarIdentifier from its cache.org.apache.xerces.xni.grammars.Grammar[]retrieveInitialGrammarSet(String grammarType) retrieve the initial known set of grammars.voidunlock the grammar pool
-
Constructor Details
-
SynchronizedGrammarPool
public SynchronizedGrammarPool(org.apache.xerces.xni.grammars.XMLGrammarPool grammarPool) Constructs a synchronized grammar pool.
-
-
Method Details
-
retrieveInitialGrammarSet
Description copied from interface:org.apache.xerces.xni.grammars.XMLGrammarPoolretrieve 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.
- Specified by:
retrieveInitialGrammarSetin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Parameters:
grammarType- the type of the grammar, from theorg.apache.xerces.xni.grammars.Grammarinterface.- Returns:
- the set of grammars the validator may put in its "bucket"
-
retrieveGrammar
public org.apache.xerces.xni.grammars.Grammar retrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription gDesc) Description copied from interface:org.apache.xerces.xni.grammars.XMLGrammarPoolThis 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.
- Specified by:
retrieveGrammarin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Parameters:
gDesc- The description of the Grammar being requested.- Returns:
- the Grammar corresponding to this description or null if no such Grammar is known.
-
cacheGrammars
Description copied from interface:org.apache.xerces.xni.grammars.XMLGrammarPoolreturn 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.
- Specified by:
cacheGrammarsin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Parameters:
grammarType- the type of the grammars being returned;grammars- an array containing the set of grammars being returned; order is not significant.
-
lockPool
public void lockPool()lock the grammar pool- Specified by:
lockPoolin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool
-
clear
public void clear()clear the grammar pool- Specified by:
clearin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool
-
unlockPool
public void unlockPool()unlock the grammar pool- Specified by:
unlockPoolin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool
-