com.skaringa.javaxml.handler.sax
Class SAXOutputHandler

java.lang.Object
  extended by com.skaringa.javaxml.handler.AbstractDocumentOutputHandler
      extended by com.skaringa.javaxml.handler.sax.SAXOutputHandler
All Implemented Interfaces:
DocumentOutputHandlerInterface

public final class SAXOutputHandler
extends AbstractDocumentOutputHandler
implements DocumentOutputHandlerInterface

A concrete DocumentOutputHandlerInterface. It writes the output events to a SAX content handler. It is used for serialization of Java objects into XML documents.


Constructor Summary
SAXOutputHandler(org.xml.sax.ContentHandler ch)
          Construct a new SAXOutputHandler.
 
Method Summary
 void appendText(java.lang.String text)
          Append text to the current element.
 void endDocument()
          End the document.
 void endElement(java.lang.String name)
          End the current element.
 void startDocument()
          Start a new document.
 void startElement(java.lang.String name)
          Start a new element without attributes at the current element.
 void startElement(java.lang.String name, org.xml.sax.Attributes attrs)
          Start a new element at the current element.
 
Methods inherited from class com.skaringa.javaxml.handler.AbstractDocumentOutputHandler
appendNamespaceDeclarations, getProperties, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.skaringa.javaxml.handler.DocumentOutputHandlerInterface
getProperties, setProperties
 

Constructor Detail

SAXOutputHandler

public SAXOutputHandler(org.xml.sax.ContentHandler ch)
Construct a new SAXOutputHandler.

Parameters:
ch - The SAX content handler which gets the output events.
Method Detail

startDocument

public void startDocument()
                   throws SerializerException
Description copied from interface: DocumentOutputHandlerInterface
Start a new document.

Specified by:
startDocument in interface DocumentOutputHandlerInterface
Throws:
SerializerException - If the operation failes.
See Also:
DocumentOutputHandlerInterface.startDocument()

endDocument

public void endDocument()
                 throws SerializerException
Description copied from interface: DocumentOutputHandlerInterface
End the document.

Specified by:
endDocument in interface DocumentOutputHandlerInterface
Throws:
SerializerException - If the operation failes.
See Also:
DocumentOutputHandlerInterface.endDocument()

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.Attributes attrs)
                  throws SerializerException
Description copied from interface: DocumentOutputHandlerInterface
Start a new element at the current element.

Specified by:
startElement in interface DocumentOutputHandlerInterface
Parameters:
name - The name of the element.
attrs - The attributes of the element.
Throws:
SerializerException - If the operation failes.
See Also:
DocumentOutputHandlerInterface.startElement(String, Attributes)

startElement

public void startElement(java.lang.String name)
                  throws SerializerException
Description copied from interface: DocumentOutputHandlerInterface
Start a new element without attributes at the current element.

Specified by:
startElement in interface DocumentOutputHandlerInterface
Parameters:
name - The name of the element.
Throws:
SerializerException - If the operation failes.
See Also:
DocumentOutputHandlerInterface.startElement(String)

appendText

public void appendText(java.lang.String text)
                throws SerializerException
Description copied from interface: DocumentOutputHandlerInterface
Append text to the current element.

Specified by:
appendText in interface DocumentOutputHandlerInterface
Parameters:
text - The text to append.
Throws:
SerializerException - If the operation failes.
See Also:
DocumentOutputHandlerInterface.appendText(String)

endElement

public void endElement(java.lang.String name)
                throws SerializerException
Description copied from interface: DocumentOutputHandlerInterface
End the current element.

Specified by:
endElement in interface DocumentOutputHandlerInterface
Parameters:
name - The name of the element.
Throws:
SerializerException - If the operation failes.
See Also:
DocumentOutputHandlerInterface.endElement(String)