org.eclipse.emf.ecore.xmi
Interface XMLParserPool

All Known Implementing Classes:
XMLParserPoolImpl

public interface XMLParserPool

A pool of parsers that a resource implementation can use to get a parser instance for parsing XML instance documents. 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.


Method Summary
 SAXParser get(Map features, Map properties, boolean useLexicalHandler)
          Retrieves a parser from the pool given specified properties and features.
 void release(SAXParser parser, Map features, Map properties, boolean useLexicalHandler)
          Returns the parser to the pool.
 

Method Detail

get

public SAXParser get(Map features,
                     Map properties,
                     boolean useLexicalHandler)
              throws ParserConfigurationException,
                     SAXException
Retrieves a parser from the pool given specified properties and features. If parser can't be created using specified properties or features, an exception can be thrown.

Parameters:
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.
Returns:
A parser instance with given features and properties.
Throws:
ParserConfigurationException
SAXException

release

public void release(SAXParser parser,
                    Map features,
                    Map properties,
                    boolean useLexicalHandler)
Returns the parser to the pool.

Parameters:
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.

Copyright 2001-2004 IBM Corporation and others.
All Rights Reserved.