|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an interface to cache parsers and parser's handlers (XMLDefaultHandler) to improve
deserialization performance.
The use of a parser pool can be specified using XMLResource.OPTION_USE_PARSER_POOL
load option.
The parser instance is retrieved and placed back to the pool
based on the features and properties specified for this parser.
The default implementation is provided by XMLParserPoolImpl
.
Note that the correct properties and feature maps for this parser instance must be provided when retrieving the parser from the pool and, even more importantly when, releasing the parser back to the pool. Failure to do so will result in improperly configured parsers.
The handler instance is retrieved and placed back to the pool
based on the options map specified for loading a resource.
The default implementation is provided by XMLParserPoolImpl
.
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. |
Method Detail |
public SAXParser get(Map features, Map properties, boolean useLexicalHandler) throws ParserConfigurationException, SAXException
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
public void release(SAXParser parser, Map features, Map properties, boolean useLexicalHandler)
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.public XMLDefaultHandler getDefaultHandler(XMLResource resource, XMLLoad xmlLoad, XMLHelper helper, Map options)
resource
- - the resourcexmlLoad
- - the XMLLoadhelper
- - XMLHelperoptions
- public void releaseDefaultHandler(XMLDefaultHandler handler, Map options)
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 |