Home » Xerces-J-src.2.9.1 » xni » parser » [javadoc | source]
xni.parser
abstract public class: AbstractConfiguration [javadoc | source]
java.lang.Object
   xni.parser.AbstractConfiguration

All Implemented Interfaces:
    XMLParserConfiguration

Direct Known Subclasses:
    CSVConfiguration

This abstract parser configuration simply helps manage components, features and properties, and other tasks common to all parser configurations. In order to subclass this configuration and use it effectively, the subclass is required to do the following:
Field Summary
protected final  Vector fRecognizedFeatures    Recognized features. 
protected final  Vector fRecognizedProperties    Recognized properties. 
protected final  Hashtable fFeatures    Features. 
protected final  Hashtable fProperties    Properties. 
protected  XMLEntityResolver fEntityResolver    The registered entity resolver. 
protected  XMLErrorHandler fErrorHandler    The registered error handler. 
protected  XMLDocumentHandler fDocumentHandler    The registered document handler. 
protected  XMLDTDHandler fDTDHandler    The registered DTD handler. 
protected  XMLDTDContentModelHandler fDTDContentModelHandler    The registered DTD content model handler. 
protected  Locale fLocale    Locale for error messages. 
protected final  Vector fComponents    List of configurable components. 
Method from xni.parser.AbstractConfiguration Summary:
addComponent,   addRecognizedFeatures,   addRecognizedProperties,   getDTDContentModelHandler,   getDTDHandler,   getDocumentHandler,   getEntityResolver,   getErrorHandler,   getFeature,   getLocale,   getProperty,   openInputSourceStream,   parse,   resetComponents,   setDTDContentModelHandler,   setDTDHandler,   setDocumentHandler,   setEntityResolver,   setErrorHandler,   setFeature,   setLocale,   setProperty
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from xni.parser.AbstractConfiguration Detail:
 protected  void addComponent(XMLComponent component) 
    Adds a component to list of configurable components. If the same component is added multiple times, the component is added only the first time.

    This method helps manage the components in the configuration. Therefore, all subclasses should call this method to add the components specific to the configuration.

 public  void addRecognizedFeatures(String[] featureIds) 
    Allows a parser to add parser specific features to be recognized and managed by the parser configuration.
 public  void addRecognizedProperties(String[] propertyIds) 
    Allows a parser to add parser specific properties to be recognized and managed by the parser configuration.
 public XMLDTDContentModelHandler getDTDContentModelHandler() 
    Returns the registered DTD content model handler.
 public XMLDTDHandler getDTDHandler() 
    Returns the registered DTD handler.
 public XMLDocumentHandler getDocumentHandler() 
    Returns the registered document handler.
 public XMLEntityResolver getEntityResolver() 
    Returns the registered entity resolver.
 public XMLErrorHandler getErrorHandler() 
    Returns the registered error handler.
 public boolean getFeature(String featureId) throws XMLConfigurationException 
    Returns the state of a feature.
 public Locale getLocale() 
    Returns the locale.
 public Object getProperty(String propertyId) throws XMLConfigurationException 
    Returns the value of a property.
 protected  void openInputSourceStream(XMLInputSource source) throws IOException 
    This method tries to open the necessary stream for the given XMLInputSource. If the input source already has a character stream (java.io.Reader) or a byte stream (java.io.InputStream) set, this method returns immediately. However, if no character or byte stream is already open, this method attempts to open an input stream using the source's system identifier.
 abstract public  void parse(XMLInputSource inputSource) throws IOException, XNIException
    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.

    Note: This method needs to be implemented by the subclass.

 protected  void resetComponents() throws XMLConfigurationException 
    Resets all of the registered components. Before the subclassed configuration begins parsing, it should call this method to reset the components.
 public  void setDTDContentModelHandler(XMLDTDContentModelHandler handler) 
    Sets the DTD content model handler.
 public  void setDTDHandler(XMLDTDHandler handler) 
    Sets the DTD handler.
 public  void setDocumentHandler(XMLDocumentHandler handler) 
    Sets the document handler to receive information about the document.
 public  void setEntityResolver(XMLEntityResolver resolver) 
    Sets the entity resolver.
 public  void setErrorHandler(XMLErrorHandler handler) 
    Sets the error handler.
 public  void setFeature(String featureId,
    boolean state) throws XMLConfigurationException 
    Sets the state of a feature. This method is called by the parser and gets propagated to components in this parser configuration.
 public  void setLocale(Locale locale) 
    Set the locale to use for messages.
 public  void setProperty(String propertyId,
    Object value) throws XMLConfigurationException 
    Sets the value of a property. This method is called by the parser and gets propagated to components in this parser configuration.