|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl
This is the default thread safe implementation of XMLParserPool. This implementation is tuned for caching parsers and handlers created using same loading options. To avoid possible memory leak (in case user is trying to parse documents using different options for every parse), there is a restriction on the size of the pool. The key used for handler caching is based on the option map passed to load.
Constructor Summary | |
XMLParserPoolImpl()
Creates an instance that caches only parsers but not handlers. |
|
XMLParserPoolImpl(boolean useHandlerCache)
Creates an instance that caches parsers and caches handlers as specified. |
|
XMLParserPoolImpl(int size,
boolean useHandlerCache)
Creates an instance that caches parsers and caches handlers as specified. |
Method Summary | |
SAXParser |
get(Map features,
Map properties,
boolean useLexicalHandler)
Retrieves a parser from the pool given specified properties and features. |
XMLDefaultHandler |
getDefaultHandler(XMLResource resource,
XMLLoad xmlLoad,
XMLHelper helper,
Map options)
Retrives XMLDefaultHandler from the pool and initializes / prepares it. |
void |
release(SAXParser parser,
Map features,
Map properties,
boolean useLexicalHandler)
Returns the parser to the pool. |
void |
releaseDefaultHandler(XMLDefaultHandler handler,
Map options)
Returns the XMLDefaultHandler to the pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLParserPoolImpl()
XMLParserPoolImpl(boolean)
public XMLParserPoolImpl(boolean useHandlerCache)
useHandlerCache
- indicates whether handler caching should be use.XMLParserPoolImpl(boolean)
public XMLParserPoolImpl(int size, boolean useHandlerCache)
size
- indicates the maximum number of instances parser or handler instances that will be cached.useHandlerCache
- indicates whether handler caching should be use.XMLParserPoolImpl(boolean)
Method Detail |
public SAXParser get(Map features, Map properties, boolean useLexicalHandler) throws ParserConfigurationException, SAXException
XMLParserPool
get
in interface XMLParserPool
features
- a map of the parser features and their values.properties
- a map of a parser properties and their values.useLexicalHandler
- whether a lexical handler was set during loading.
ParserConfigurationException
SAXException
XMLParserPool.get(Map, Map, boolean)
public void release(SAXParser parser, Map features, Map properties, boolean useLexicalHandler)
XMLParserPool
release
in interface XMLParserPool
parser
- the parser to return to the pool.features
- a map of the parser features and their values.properties
- a map of a parser properties and their values.useLexicalHandler
- whether a lexical handler was set during loading.XMLParserPool.release(SAXParser, Map, Map, boolean)
public XMLDefaultHandler getDefaultHandler(XMLResource resource, XMLLoad xmlLoad, XMLHelper helper, Map options)
XMLParserPool
getDefaultHandler
in interface XMLParserPool
resource
- - the resourcexmlLoad
- - the XMLLoadhelper
- - XMLHelperoptions
- public void releaseDefaultHandler(XMLDefaultHandler handler, Map options)
XMLParserPool
releaseDefaultHandler
in interface XMLParserPool
handler
- the handler to return to the pooloptions
-
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |