org.xml.sax.helpers
Class XMLFilterImpl

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader

public synchronized class XMLFilterImpl
extends java.lang.Object
implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler


Constructor Summary
XMLFilterImpl()
           
XMLFilterImpl(XMLReader)
           
 
Method Summary
 void characters(char[], int, int)
           
 void endDocument()
           
 void endElement(java.lang.String, java.lang.String, java.lang.String)
           
 void endPrefixMapping(java.lang.String)
           
 void error(SAXParseException)
          Receive notification of a recoverable error.
 void fatalError(SAXParseException)
          Receive notification of a non-recoverable error.
 ContentHandler getContentHandler()
           
 DTDHandler getDTDHandler()
           
 EntityResolver getEntityResolver()
           
 ErrorHandler getErrorHandler()
           
 boolean getFeature(java.lang.String)
           
 XMLReader getParent()
           
 java.lang.Object getProperty(java.lang.String)
           
 void ignorableWhitespace(char[], int, int)
           
 void notationDecl(java.lang.String, java.lang.String, java.lang.String)
          Receive notification of a notation declaration event.
 void parse(InputSource)
           
 void parse(java.lang.String)
           
 void processingInstruction(java.lang.String, java.lang.String)
           
 InputSource resolveEntity(java.lang.String, java.lang.String)
          Allow the application to resolve external entities.
 void setContentHandler(ContentHandler)
           
 void setDocumentLocator(Locator)
           
 void setDTDHandler(DTDHandler)
           
 void setEntityResolver(EntityResolver)
           
 void setErrorHandler(ErrorHandler)
           
 void setFeature(java.lang.String, boolean)
           
 void setParent(XMLReader)
           
 void setProperty(java.lang.String, java.lang.Object)
           
 void skippedEntity(java.lang.String)
           
 void startDocument()
           
 void startElement(java.lang.String, java.lang.String, java.lang.String, Attributes)
           
 void startPrefixMapping(java.lang.String, java.lang.String)
           
 void unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
          Receive notification of an unparsed entity declaration event.
 void warning(SAXParseException)
          Receive notification of a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLFilterImpl

public XMLFilterImpl()

XMLFilterImpl

public XMLFilterImpl(XMLReader)
Method Detail

setParent

public void setParent(XMLReader)
Specified by:
setParent in interface XMLFilter

getParent

public XMLReader getParent()
Specified by:
getParent in interface XMLFilter

setFeature

public void setFeature(java.lang.String,
                       boolean)
                throws SAXNotRecognizedException,
                       SAXNotSupportedException
Specified by:
setFeature in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException

getFeature

public boolean getFeature(java.lang.String)
                   throws SAXNotRecognizedException,
                          SAXNotSupportedException
Specified by:
getFeature in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException

setProperty

public void setProperty(java.lang.String,
                        java.lang.Object)
                 throws SAXNotRecognizedException,
                        SAXNotSupportedException
Specified by:
setProperty in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException

getProperty

public java.lang.Object getProperty(java.lang.String)
                             throws SAXNotRecognizedException,
                                    SAXNotSupportedException
Specified by:
getProperty in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException

setEntityResolver

public void setEntityResolver(EntityResolver)
Specified by:
setEntityResolver in interface XMLReader

getEntityResolver

public EntityResolver getEntityResolver()
Specified by:
getEntityResolver in interface XMLReader

setDTDHandler

public void setDTDHandler(DTDHandler)
Specified by:
setDTDHandler in interface XMLReader

getDTDHandler

public DTDHandler getDTDHandler()
Specified by:
getDTDHandler in interface XMLReader

setContentHandler

public void setContentHandler(ContentHandler)
Specified by:
setContentHandler in interface XMLReader

getContentHandler

public ContentHandler getContentHandler()
Specified by:
getContentHandler in interface XMLReader

setErrorHandler

public void setErrorHandler(ErrorHandler)
Specified by:
setErrorHandler in interface XMLReader

getErrorHandler

public ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface XMLReader

parse

public void parse(InputSource)
           throws SAXException,
                  java.io.IOException
Specified by:
parse in interface XMLReader
SAXException
java.io.IOException

parse

public void parse(java.lang.String)
           throws SAXException,
                  java.io.IOException
Specified by:
parse in interface XMLReader
SAXException
java.io.IOException

resolveEntity

public InputSource resolveEntity(java.lang.String,
                                 java.lang.String)
                          throws SAXException,
                                 java.io.IOException
Description copied from interface: EntityResolver
Allow the application to resolve external entities.

The Parser will call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element): the application may request that the parser resolve the entity itself, that it use an alternative URI, or that it use an entirely different input source.

Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box).

If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.

Specified by:
resolveEntity in interface EntityResolver
Parameters:
- The public identifier of the external entity being referenced, or null if none was supplied.
- The system identifier of the external entity being referenced.
Returns:
An InputSource object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier.
Throws:
java.io.IOException - A Java-specific IO exception, possibly the result of creating a new InputStream or Reader for the InputSource.
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
InputSource

notationDecl

public void notationDecl(java.lang.String,
                         java.lang.String,
                         java.lang.String)
                  throws SAXException
Description copied from interface: DTDHandler
Receive notification of a notation declaration event.

It is up to the application to record the notation for later reference, if necessary.

If a system identifier is present, and it is a URL, the SAX parser must resolve it fully before passing it to the application.

Specified by:
notationDecl in interface DTDHandler
Parameters:
- The notation name.
- The notation's public identifier, or null if none was given.
- The notation's system identifier, or null if none was given.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String), AttributeList

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String,
                               java.lang.String,
                               java.lang.String,
                               java.lang.String)
                        throws SAXException
Description copied from interface: DTDHandler
Receive notification of an unparsed entity declaration event.

Note that the notation name corresponds to a notation reported by the notationDecl() event. It is up to the application to record the entity for later reference, if necessary.

If the system identifier is a URL, the parser must resolve it fully before passing it to the application.

Specified by:
unparsedEntityDecl in interface DTDHandler
Parameters:
- The unparsed entity's name.
- The entity's public identifier, or null if none was given.
- The entity's system identifier (it must always have one).
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String), AttributeList

setDocumentLocator

public void setDocumentLocator(Locator)
Specified by:
setDocumentLocator in interface ContentHandler

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String,
                               java.lang.String)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
SAXException

startElement

public void startElement(java.lang.String,
                         java.lang.String,
                         java.lang.String,
                         Attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
SAXException

endElement

public void endElement(java.lang.String,
                       java.lang.String,
                       java.lang.String)
                throws SAXException
Specified by:
endElement in interface ContentHandler
SAXException

characters

public void characters(char[],
                       int,
                       int)
                throws SAXException
Specified by:
characters in interface ContentHandler
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[],
                                int,
                                int)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
SAXException

processingInstruction

public void processingInstruction(java.lang.String,
                                  java.lang.String)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
SAXException

skippedEntity

public void skippedEntity(java.lang.String)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
SAXException

warning

public void warning(SAXParseException)
             throws SAXException
Description copied from interface: ErrorHandler
Receive notification of a warning.

SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.

The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.

Specified by:
warning in interface ErrorHandler
Parameters:
- The warning information encapsulated in a SAX parse exception.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
SAXParseException

error

public void error(SAXParseException)
           throws SAXException
Description copied from interface: ErrorHandler
Receive notification of a recoverable error.

This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.

The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML 1.0 recommendation does not require it to do so.

Specified by:
error in interface ErrorHandler
Parameters:
- The error information encapsulated in a SAX parse exception.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
SAXParseException

fatalError

public void fatalError(SAXParseException)
                throws SAXException
Description copied from interface: ErrorHandler
Receive notification of a non-recoverable error.

This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a parser would use this callback to report the violation of a well-formedness constraint.

The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.

Specified by:
fatalError in interface ErrorHandler
Parameters:
- The error information encapsulated in a SAX parse exception.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
SAXParseException