org.apache.xerces.parsers
Class NonValidatingConfiguration

java.lang.Object
  extended by org.apache.xerces.util.ParserConfigurationSettings
      extended by org.apache.xerces.parsers.BasicParserConfiguration
          extended by org.apache.xerces.parsers.NonValidatingConfiguration
All Implemented Interfaces:
XMLComponentManager, XMLParserConfiguration, XMLPullParserConfiguration

public class NonValidatingConfiguration
extends BasicParserConfiguration
implements XMLPullParserConfiguration

This is the non validating parser configuration. It extends the basic configuration with the set of following parser components: Document scanner, DTD scanner, namespace binder, document handler.

Xerces parser that uses this configuration is not conformant non-validating XML processor, since conformant non-validating processor is required to process "all the declarations they read in the internal DTD subset ... must use the information in those declarations to normalize attribute values, include the replacement text of internal entities, and supply default attribute values".

Version:
$Id: NonValidatingConfiguration.java 447239 2006-09-18 05:08:26Z mrglavas $
Author:
Elena Litani, IBM

Constructor Summary
NonValidatingConfiguration()
          Default constructor.
NonValidatingConfiguration(SymbolTable symbolTable)
          Constructs a parser configuration using the specified symbol table.
NonValidatingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool)
          Constructs a parser configuration using the specified symbol table and grammar pool.
NonValidatingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings)
          Constructs a parser configuration using the specified symbol table, grammar pool, and parent settings.
 
Method Summary
 void cleanup()
          If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing.
 boolean getFeature(java.lang.String featureId)
          Returns the state of a feature.
 boolean parse(boolean complete)
          Parses the document in a pull parsing fashion.
 void parse(XMLInputSource source)
          Parses the specified input source.
 void setFeature(java.lang.String featureId, boolean state)
          Set the state of a feature.
 void setInputSource(XMLInputSource inputSource)
          Sets the input source for the document to parse.
 void setLocale(java.util.Locale locale)
          Set the locale to use for messages.
 void setProperty(java.lang.String propertyId, java.lang.Object value)
          setProperty
 
Methods inherited from class org.apache.xerces.parsers.BasicParserConfiguration
getDocumentHandler, getDTDContentModelHandler, getDTDHandler, getEntityResolver, getErrorHandler, getLocale, setDocumentHandler, setDTDContentModelHandler, setDTDHandler, setEntityResolver, setErrorHandler
 
Methods inherited from class org.apache.xerces.util.ParserConfigurationSettings
addRecognizedFeatures, addRecognizedProperties, getProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.xerces.xni.parser.XMLParserConfiguration
addRecognizedFeatures, addRecognizedProperties, getDocumentHandler, getDTDContentModelHandler, getDTDHandler, getEntityResolver, getErrorHandler, getLocale, getProperty, setDocumentHandler, setDTDContentModelHandler, setDTDHandler, setEntityResolver, setErrorHandler
 

Constructor Detail

NonValidatingConfiguration

public NonValidatingConfiguration()
Default constructor.


NonValidatingConfiguration

public NonValidatingConfiguration(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.

Parameters:
symbolTable - The symbol table to use.

NonValidatingConfiguration

public NonValidatingConfiguration(SymbolTable symbolTable,
                                  XMLGrammarPool grammarPool)
Constructs a parser configuration using the specified symbol table and grammar pool.

REVISIT: Grammar pool will be updated when the new validation engine is implemented.

Parameters:
symbolTable - The symbol table to use.
grammarPool - The grammar pool to use.

NonValidatingConfiguration

public NonValidatingConfiguration(SymbolTable symbolTable,
                                  XMLGrammarPool grammarPool,
                                  XMLComponentManager parentSettings)
Constructs a parser configuration using the specified symbol table, grammar pool, and parent settings.

REVISIT: Grammar pool will be updated when the new validation engine is implemented.

Parameters:
symbolTable - The symbol table to use.
grammarPool - The grammar pool to use.
parentSettings - The parent settings.
Method Detail

setFeature

public void setFeature(java.lang.String featureId,
                       boolean state)
                throws XMLConfigurationException
Description copied from class: BasicParserConfiguration
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.

Specified by:
setFeature in interface XMLParserConfiguration
Overrides:
setFeature in class BasicParserConfiguration
Parameters:
featureId - The unique identifier (URI) of the feature.
state - The requested state of the feature (true or false).
Throws:
XMLConfigurationException - Thrown if there is a configuration error.

setProperty

public void setProperty(java.lang.String propertyId,
                        java.lang.Object value)
                 throws XMLConfigurationException
Description copied from class: BasicParserConfiguration
setProperty

Specified by:
setProperty in interface XMLParserConfiguration
Overrides:
setProperty in class BasicParserConfiguration
Parameters:
propertyId - The property identifier.
value - The value of the property.
Throws:
XMLConfigurationException - Thrown if there is a configuration error.

setLocale

public void setLocale(java.util.Locale locale)
               throws XNIException
Set the locale to use for messages.

Specified by:
setLocale in interface XMLParserConfiguration
Overrides:
setLocale in class BasicParserConfiguration
Parameters:
locale - The locale object to use for localization of messages.
Throws:
XNIException - Thrown if the parser does not support the specified locale.

getFeature

public boolean getFeature(java.lang.String featureId)
                   throws XMLConfigurationException
Description copied from class: ParserConfigurationSettings
Returns the state of a feature.

Specified by:
getFeature in interface XMLComponentManager
Specified by:
getFeature in interface XMLParserConfiguration
Overrides:
getFeature in class ParserConfigurationSettings
Parameters:
featureId - The feature identifier.
Returns:
true if the feature is supported
Throws:
XMLConfigurationException - Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

setInputSource

public void setInputSource(XMLInputSource inputSource)
                    throws XMLConfigurationException,
                           java.io.IOException
Sets the input source for the document to parse.

Specified by:
setInputSource in interface XMLPullParserConfiguration
Parameters:
inputSource - The document's input source.
Throws:
XMLConfigurationException - Thrown if there is a configuration error when initializing the parser.
java.io.IOException - Thrown on I/O error.
See Also:
parse(boolean)

parse

public boolean parse(boolean complete)
              throws XNIException,
                     java.io.IOException
Parses the document in a pull parsing fashion.

Specified by:
parse in interface XMLPullParserConfiguration
Parameters:
complete - True if the pull parser should parse the remaining document completely.
Returns:
True if there is more document to parse.
Throws:
XNIException - Any XNI exception, possibly wrapping another exception.
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the parser.
See Also:
setInputSource(org.apache.xerces.xni.parser.XMLInputSource)

cleanup

public void cleanup()
If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing. For example, close all opened streams.

Specified by:
cleanup in interface XMLPullParserConfiguration

parse

public void parse(XMLInputSource source)
           throws XNIException,
                  java.io.IOException
Parses the specified input source.

Specified by:
parse in interface XMLParserConfiguration
Specified by:
parse in class BasicParserConfiguration
Parameters:
source - The input source.
Throws:
XNIException - Throws exception on XNI error.
java.io.IOException - Throws exception on i/o error.