Name
The ParserAdapter Class
Synopsis
The ParserAdapter
class uses the adapter design pattern to convert a SAX1 org.xml.sax.Parser
object into a SAX2
org.xml.sax.XMLReader
object.
As more parsers support SAX2, this class becomes less necessary.
Note that some SAX2 features are not available through an adapted
SAX1 parser. For instance, a parser created with this adapter does
not report skipped entities and does not support most features and
properties, not even the core features and properties:
package org.xml.sax.helpers; public classParserAdapter
implements XMLReader, DocumentHandler { publicParserAdapter
( ) throws SAXException; publicParserAdapter
(Parserparser
); // Implementation of org.xml.sax.XMLReader. public voidsetFeature
(Stringname
, booleanstate
) throws SAXNotRecognizedException, SAXNotSupportedException; public booleangetFeature
(Stringname
) throws SAXNotRecognizedException, SAXNotSupportedException; public voidsetProperty
(Stringname
, Objectvalue
) throws SAXNotRecognizedException, SAXNotSupportedException; public ObjectgetProperty
(Stringname
) throws SAXNotRecognizedException, SAXNotSupportedException; public voidsetEntityResolver
(EntityResolverresolver
); public EntityResolvergetEntityResolver
( ); public voidsetDTDHandler
(DTDHandlerhandler
); public DTDHandlergetDTDHandler
( ); public voidsetContentHandler
(ContentHandlerhandler
); public ContentHandlergetContentHandler
( ); public voidsetErrorHandler
(ErrorHandlerhandler
); public ErrorHandlergetErrorHandler ...
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.