| |
|
| java.lang.Object org.apache.xerces.util.ParserConfigurationSettings org.apache.xerces.parsers.BasicParserConfiguration
All known Subclasses: org.apache.xerces.parsers.NonValidatingConfiguration, org.apache.xerces.impl.xs.opti.SchemaParsingConfig, org.apache.xerces.parsers.DTDConfiguration,
BasicParserConfiguration | abstract public class BasicParserConfiguration extends ParserConfigurationSettings implements XMLParserConfiguration(Code) | | A very basic parser configuration. This configuration class can
be used as a base class for custom parser configurations. The
basic parser configuration creates the symbol table (if not
specified at construction time) and manages all of the recognized
features and properties.
The basic parser configuration does not mandate
any particular pipeline configuration or the use of specific
components except for the symbol table. If even this is too much
for a basic parser configuration, the programmer can create a new
configuration class that implements the
XMLParserConfiguration interface.
Subclasses of the basic parser configuration can add their own
recognized features and properties by calling the
addRecognizedFeature and
addRecognizedProperty methods, respectively.
The basic parser configuration assumes that the configuration
will be made up of various parser components that implement the
XMLComponent interface. If subclasses of this
configuration create their own components for use in the
parser configuration, then each component should be added to
the list of components by calling the addComponent
method. The basic parser configuration will make sure to call
the reset method of each registered component
before parsing an instance document.
This class recognizes the following features and properties:
- Features
- http://xml.org/sax/features/validation
- http://xml.org/sax/features/namespaces
- http://xml.org/sax/features/external-general-entities
- http://xml.org/sax/features/external-parameter-entities
- Properties
- http://xml.org/sax/properties/xml-string
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-handler
- http://apache.org/xml/properties/internal/entity-resolver
author: Arnaud Le Hors, IBM author: Andy Clark, IBM version: $Id: BasicParserConfiguration.java 447239 2006-09-18 05:08:26Z mrglavas $ |
ENTITY_RESOLVER | final protected static String ENTITY_RESOLVER(Code) | | Property identifier: entity resolver.
|
ERROR_HANDLER | final protected static String ERROR_HANDLER(Code) | | Property identifier: error handler.
|
EXTERNAL_GENERAL_ENTITIES | final protected static String EXTERNAL_GENERAL_ENTITIES(Code) | | Feature identifier: external general entities.
|
EXTERNAL_PARAMETER_ENTITIES | final protected static String EXTERNAL_PARAMETER_ENTITIES(Code) | | Feature identifier: external parameter entities.
|
NAMESPACES | final protected static String NAMESPACES(Code) | | Feature identifier: namespaces.
|
SYMBOL_TABLE | final protected static String SYMBOL_TABLE(Code) | | Property identifier: symbol table.
|
VALIDATION | final protected static String VALIDATION(Code) | | Feature identifier: validation.
|
XML_STRING | final protected static String XML_STRING(Code) | | Property identifier: xml string.
|
BasicParserConfiguration | protected BasicParserConfiguration()(Code) | | Default Constructor.
|
BasicParserConfiguration | protected BasicParserConfiguration(SymbolTable symbolTable)(Code) | | Constructs a parser configuration using the specified symbol table.
Parameters: symbolTable - The symbol table to use. |
BasicParserConfiguration | protected BasicParserConfiguration(SymbolTable symbolTable, XMLComponentManager parentSettings)(Code) | | Constructs a parser configuration using the specified symbol table
and parent settings.
Parameters: symbolTable - The symbol table to use. Parameters: parentSettings - The parent settings. |
addComponent | protected void addComponent(XMLComponent component)(Code) | | Adds a component to the parser configuration. This method will
also add all of the component's recognized features and properties
to the list of default recognized features and properties.
Parameters: component - The component to add. |
checkFeature | protected void checkFeature(String featureId) throws XMLConfigurationException(Code) | | Check a feature. If feature is know and supported, this method simply
returns. Otherwise, the appropriate exception is thrown.
Parameters: featureId - The unique identifier (URI) of the feature. throws: XMLConfigurationException - Thrown for configuration error.In general, components shouldonly throw this exception ifit is reallya critical error. |
getLocale | public Locale getLocale()(Code) | | Returns the locale.
|
parse | abstract public void parse(XMLInputSource inputSource) throws XNIException, IOException(Code) | | Parse an XML document.
The parser can use this method to instruct this configuration
to begin parsing an XML document from any valid input source
(a character stream, a byte stream, or a URI).
Parsers may not invoke this method while a parse is in progress.
Once a parse is complete, the parser may then parse another XML
document.
This method is synchronous: it will not return until parsing
has ended. If a client application wants to terminate
parsing early, it should throw an exception.
Parameters: inputSource - The input source for the top-level of theXML document. exception: XNIException - Any XNI exception, possibly wrapping another exception. exception: IOException - An IO exception from the parser, possiblyfrom a byte stream or character streamsupplied by the parser. |
reset | protected void reset() throws XNIException(Code) | | reset all components before parsing and namespace context
|
setDTDContentModelHandler | public void setDTDContentModelHandler(XMLDTDContentModelHandler handler)(Code) | | Sets the DTD content model handler.
Parameters: handler - The DTD content model handler. |
setDTDHandler | public void setDTDHandler(XMLDTDHandler dtdHandler)(Code) | | Sets the DTD handler.
Parameters: dtdHandler - The DTD handler. |
setDocumentHandler | public void setDocumentHandler(XMLDocumentHandler documentHandler)(Code) | | Sets the document handler on the last component in the pipeline
to receive information about the document.
Parameters: documentHandler - The document handler. |
setEntityResolver | public void setEntityResolver(XMLEntityResolver resolver)(Code) | | Sets the resolver used to resolve external entities. The EntityResolver
interface supports resolution of public and system identifiers.
Parameters: resolver - The new entity resolver. Passing a null value willuninstall the currently installed resolver. |
setErrorHandler | public void setErrorHandler(XMLErrorHandler errorHandler)(Code) | | Allow an application to register an error event handler.
If the application does not register an error handler, all
error events reported by the SAX parser will be silently
ignored; however, normal processing may not continue. It is
highly recommended that all SAX applications implement an
error handler to avoid unexpected bugs.
Applications may register a new or different handler in the
middle of a parse, and the SAX parser must begin using the new
handler immediately.
Parameters: errorHandler - The error handler. exception: java.lang.NullPointerException - If the handler argument is null. See Also: BasicParserConfiguration.getErrorHandler |
setFeature | public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code) | | Set the state of a feature.
Set the state of any feature in a SAX2 parser. The parser
might not recognize the feature, and if it does recognize
it, it might not be able to fulfill the request.
Parameters: featureId - The unique identifier (URI) of the feature. Parameters: state - The requested state of the feature (true or false). exception: org.apache.xerces.xni.parser.XMLConfigurationException - If therequested feature is not known. |
setLocale | public void setLocale(Locale locale) throws XNIException(Code) | | Set the locale to use for messages.
Parameters: locale - The locale object to use for localization of messages. exception: XNIException - Thrown if the parser does not support thespecified locale. |
|
|
|