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 class ParserAdapter implements XMLReader, DocumentHandler {
     
  public ParserAdapter(  ) throws SAXException;
  public ParserAdapter(Parser parser);
     
  // Implementation of org.xml.sax.XMLReader.
  public void           setFeature(String name, boolean state)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public boolean        getFeature(String name)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public void           setProperty(String name, Object value)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public Object         getProperty(String name)
   throws SAXNotRecognizedException, SAXNotSupportedException;
  public void           setEntityResolver(EntityResolver resolver);
  public EntityResolver getEntityResolver(  );
  public void           setDTDHandler(DTDHandler handler);
  public DTDHandler     getDTDHandler(  );
  public void           setContentHandler(ContentHandler handler);
  public ContentHandler getContentHandler(  );
  public void           setErrorHandler(ErrorHandler handler);
  public ErrorHandler   getErrorHandler ...

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.