com.skaringa.javaxml.handler.sax
Class AbstractXMLReader

java.lang.Object
  extended by com.skaringa.javaxml.handler.sax.AbstractXMLReader
All Implemented Interfaces:
org.xml.sax.XMLReader
Direct Known Subclasses:
ObjectXMLReader, ObjectXSDReader

public abstract class AbstractXMLReader
extends java.lang.Object
implements org.xml.sax.XMLReader

An abstract class that implements the SAX2 XMLReader interface.


Constructor Summary
AbstractXMLReader()
           
 
Method Summary
 org.xml.sax.ContentHandler getContentHandler()
           
 org.xml.sax.DTDHandler getDTDHandler()
           
 org.xml.sax.EntityResolver getEntityResolver()
           
 org.xml.sax.ErrorHandler getErrorHandler()
           
 boolean getFeature(java.lang.String name)
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.util.Map getPropertyMap()
          Get all properties.
 void parse(org.xml.sax.InputSource input)
          Parse an input source.
 void parse(java.lang.String systemId)
           
abstract  void parseObject(java.lang.Object obj, java.lang.Class type, DocumentOutputHandlerInterface output)
          Parse an object and generate messages for a DocumentOutputHandler from its content.
 void setContentHandler(org.xml.sax.ContentHandler contentHandler)
           
 void setDTDHandler(org.xml.sax.DTDHandler dtdHandler)
           
 void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
           
 void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
           
 void setFeature(java.lang.String name, boolean value)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXMLReader

public AbstractXMLReader()
Method Detail

parseObject

public abstract void parseObject(java.lang.Object obj,
                                 java.lang.Class type,
                                 DocumentOutputHandlerInterface output)
                          throws SerializerException
Parse an object and generate messages for a DocumentOutputHandler from its content.

Parameters:
obj - The object to parse.
type - The type of the object.
output - The DocumentOutputHandler that gets the result messages.
Throws:
SerializerException - If the object can't be parsed or the DocumentOutputHandler can't handle the result messages.

parse

public final void parse(org.xml.sax.InputSource input)
                 throws java.io.IOException,
                        org.xml.sax.SAXException
Parse an input source. The input source must be of the type ObjectInputSource for this concrete implementation.

Specified by:
parse in interface org.xml.sax.XMLReader
Parameters:
input - The input source to parse.
Throws:
java.io.IOException - IOException
org.xml.sax.SAXException - SAXException
See Also:
XMLReader.parse(org.xml.sax.InputSource), ObjectInputSource

getFeature

public final boolean getFeature(java.lang.String name)
                         throws org.xml.sax.SAXNotRecognizedException,
                                org.xml.sax.SAXNotSupportedException
Specified by:
getFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
See Also:
XMLReader.getFeature(java.lang.String)

setFeature

public final void setFeature(java.lang.String name,
                             boolean value)
                      throws org.xml.sax.SAXNotRecognizedException,
                             org.xml.sax.SAXNotSupportedException
Specified by:
setFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
See Also:
XMLReader.setFeature(java.lang.String, boolean)

getProperty

public final java.lang.Object getProperty(java.lang.String name)
                                   throws org.xml.sax.SAXNotRecognizedException,
                                          org.xml.sax.SAXNotSupportedException
Specified by:
getProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
See Also:
XMLReader.getProperty(java.lang.String)

setProperty

public final void setProperty(java.lang.String name,
                              java.lang.Object value)
                       throws org.xml.sax.SAXNotRecognizedException,
                              org.xml.sax.SAXNotSupportedException
Specified by:
setProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
See Also:
XMLReader.setProperty(java.lang.String, java.lang.Object)

getPropertyMap

public final java.util.Map getPropertyMap()
Get all properties.

Returns:
Map with all properties.

setEntityResolver

public final void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Specified by:
setEntityResolver in interface org.xml.sax.XMLReader
See Also:
XMLReader.setEntityResolver(org.xml.sax.EntityResolver)

getEntityResolver

public final org.xml.sax.EntityResolver getEntityResolver()
Specified by:
getEntityResolver in interface org.xml.sax.XMLReader
See Also:
XMLReader.getEntityResolver()

setDTDHandler

public final void setDTDHandler(org.xml.sax.DTDHandler dtdHandler)
Specified by:
setDTDHandler in interface org.xml.sax.XMLReader
See Also:
XMLReader.setDTDHandler(org.xml.sax.DTDHandler)

getDTDHandler

public final org.xml.sax.DTDHandler getDTDHandler()
Specified by:
getDTDHandler in interface org.xml.sax.XMLReader
See Also:
XMLReader.getDTDHandler()

setContentHandler

public final void setContentHandler(org.xml.sax.ContentHandler contentHandler)
Specified by:
setContentHandler in interface org.xml.sax.XMLReader
See Also:
XMLReader.setContentHandler(org.xml.sax.ContentHandler)

getContentHandler

public final org.xml.sax.ContentHandler getContentHandler()
Specified by:
getContentHandler in interface org.xml.sax.XMLReader
See Also:
XMLReader.getContentHandler()

setErrorHandler

public final void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Specified by:
setErrorHandler in interface org.xml.sax.XMLReader
See Also:
XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)

getErrorHandler

public final org.xml.sax.ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface org.xml.sax.XMLReader
See Also:
XMLReader.getErrorHandler()

parse

public final void parse(java.lang.String systemId)
                 throws java.io.IOException,
                        org.xml.sax.SAXException
Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException
See Also:
XMLReader.parse(java.lang.String)