The XMLReaderAdapter Class
XMLReaderAdapter
is the reverse of ParserAdapter
; it uses the Adapter
design pattern to adapt a SAX2 XMLReader
to a SAX1 Parser
. This lets you use SAX2 parsers
for legacy programs written to a SAX1 interface:
package org.xml.sax.helpers; public classXMLReaderAdapter
implements Parser, ContentHandler { publicXMLReaderAdapter
( ) throws SAXException; publicXMLReaderAdapter
(XMLReaderreader
); // Implementation of org.xml.sax.Parser. public voidsetLocale
(Localelocale
) throws SAXException; public voidsetEntityResolver
(EntityResolverresolver
); public voidsetDTDHandler
(DTDHandlerhandler
); public voidsetDocumentHandler
(DocumentHandlerhandler
); public voidsetErrorHandler
(ErrorHandlerhandler
); public voidparse
(StringsystemID
) throws IOException, SAXException; public voidparse
(InputSourceinput
) throws IOException, SAXException // Implementation of org.xml.sax.ContentHandler. public voidsetDocumentLocator
(Locatorlocator
); public voidstartDocument
( ) throws SAXException; public voidendDocument
( ) throws SAXException; public voidstartPrefixMapping
(Stringprefix
, Stringuri
) throws SAXException; public voidendPrefixMapping
(Stringprefix
) throws SAXException; public voidstartElement
(StringnamespaceURI
, StringlocalName
, StringqualifiedName
, Attributesatts
) throws SAXException; public voidendElement
(StringnamespaceURI
, StringlocalName
, StringqualifiedName
) throws SAXException; public voidcharacters
(char[ ]text
, intstart
, intlength
) throws SAXException; public voidignorableWhitespace
(char[ ]text
, intstart
, intlength
) throws SAXException; public voidprocessingInstruction
(Stringtarget
, Stringdata
) throws SAXException; public voidskippedEntity
(Stringname
) throws SAXException; }