Class CachingParserPool.SynchronizedGrammarPool
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.parsers.CachingParserPool.SynchronizedGrammarPool
-
- All Implemented Interfaces:
XMLGrammarPool
- Enclosing class:
- CachingParserPool
public static final class CachingParserPool.SynchronizedGrammarPool extends Object implements XMLGrammarPool
Synchronized grammar pool.- Author:
- Andy Clark, IBM
-
-
Constructor Summary
Constructors Constructor Description SynchronizedGrammarPool(XMLGrammarPool grammarPool)
Constructs a synchronized grammar pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cacheGrammars(String grammarType, Grammar[] grammars)
return the final set of grammars that the validator ended up with.void
clear()
clear the grammar poolvoid
lockPool()
lock the grammar poolGrammar
retrieveGrammar(XMLGrammarDescription gDesc)
This method requests that the application retrieve a grammar corresponding to the given GrammarIdentifier from its cache.Grammar[]
retrieveInitialGrammarSet(String grammarType)
retrieve the initial known set of grammars.void
unlockPool()
unlock the grammar pool
-
-
-
Constructor Detail
-
SynchronizedGrammarPool
public SynchronizedGrammarPool(XMLGrammarPool grammarPool)
Constructs a synchronized grammar pool.
-
-
Method Detail
-
retrieveInitialGrammarSet
public Grammar[] retrieveInitialGrammarSet(String grammarType)
Description copied from interface:XMLGrammarPool
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.
- Specified by:
retrieveInitialGrammarSet
in interfaceXMLGrammarPool
- Parameters:
grammarType
- the type of the grammar, from theorg.smooks.engine.delivery.sax.ng.org.apache.xerces.xni.grammars.Grammar
interface.- Returns:
- the set of grammars the validator may put in its "bucket"
-
retrieveGrammar
public Grammar retrieveGrammar(XMLGrammarDescription gDesc)
Description copied from interface:XMLGrammarPool
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.
- Specified by:
retrieveGrammar
in interfaceXMLGrammarPool
- 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
public void cacheGrammars(String grammarType, Grammar[] grammars)
Description copied from interface:XMLGrammarPool
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.
- Specified by:
cacheGrammars
in interfaceXMLGrammarPool
- 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:
lockPool
in interfaceXMLGrammarPool
-
clear
public void clear()
clear the grammar pool- Specified by:
clear
in interfaceXMLGrammarPool
-
unlockPool
public void unlockPool()
unlock the grammar pool- Specified by:
unlockPool
in interfaceXMLGrammarPool
-
-