The XMLReader Interface
The XMLReader
interface represents the parser that reads XML documents. You
generally do not implement this interface yourself. Instead, use
the org.xml.sax.helpers.XMLReaderFactory
class to build a parser-specific implementation. Then use this
parser's various setter methods to configure the parsing process.
Finally, invoke the parse( )
method to read the document, while calling back to methods in your
own implementations of ContentHandler
, ErrorHandler
, EntityResolver
, and DTDHandler
as the document is
read:
package org.xml.sax; public interface XMLReader { public booleangetFeature
(Stringname
) throws SAXNotRecognizedException, SAXNotSupportedException; public voidsetFeature
(Stringname
, booleanvalue
) throws SAXNotRecognizedException, SAXNotSupportedException; public ObjectgetProperty
(Stringname
) throws SAXNotRecognizedException, SAXNotSupportedException; public voidsetProperty
(Stringname
, Objectvalue
) throws SAXNotRecognizedException, SAXNotSupportedException; public voidsetEntityResolver
(EntityResolverresolver
); public EntityResolvergetEntityResolver
( ); public voidsetDTDHandler
(DTDHandlerhandler
); public DTDHandlergetDTDHandler
( ); public voidsetContentHandler
(ContentHandlerhandler
); public ContentHandlergetContentHandler
( ); public voidsetErrorHandler
(ErrorHandlerhandler
); public ErrorHandlergetErrorHandler
( ); public voidparse
(InputSourceinput
) throws IOException, SAXException; public voidparse
(StringsystemID
) throws IOException, SAXException; }