|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMLParserPool
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 | |
---|---|
javax.xml.parsers.SAXParser |
get(java.util.Map<java.lang.String,java.lang.Boolean> features,
java.util.Map<java.lang.String,?> properties,
boolean useLexicalHandler)
Retrieves a parser from the pool given specified properties and features. |
XMLDefaultHandler |
getDefaultHandler(XMLResource resource,
XMLLoad xmlLoad,
XMLHelper helper,
java.util.Map<?,?> options)
Retrieves XMLDefaultHandler from the pool and initializes / prepares it. |
void |
release(javax.xml.parsers.SAXParser parser,
java.util.Map<java.lang.String,java.lang.Boolean> features,
java.util.Map<java.lang.String,?> properties,
boolean useLexicalHandler)
Returns the parser to the pool. |
void |
releaseDefaultHandler(XMLDefaultHandler handler,
java.util.Map<?,?> options)
Returns the XMLDefaultHandler to the pool. |
Method Detail |
---|
javax.xml.parsers.SAXParser get(java.util.Map<java.lang.String,java.lang.Boolean> features, java.util.Map<java.lang.String,?> properties, boolean useLexicalHandler) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.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.
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
void release(javax.xml.parsers.SAXParser parser, java.util.Map<java.lang.String,java.lang.Boolean> features, java.util.Map<java.lang.String,?> 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.XMLDefaultHandler getDefaultHandler(XMLResource resource, XMLLoad xmlLoad, XMLHelper helper, java.util.Map<?,?> options)
resource
- - the resourcexmlLoad
- - the XMLLoadhelper
- - XMLHelperoptions
- void releaseDefaultHandler(XMLDefaultHandler handler, java.util.Map<?,?> options)
handler
- the handler to return to the pooloptions
-
|
Copyright 2001-2012 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |