Joda System API

org.joda.property.xml
Class SAXOutputter

java.lang.Object
  |
  +--org.joda.property.xml.SAXOutputter

public class SAXOutputter
extends java.lang.Object

Output an object, typically a bean, as XML SAX events. An instance of this class can be re-used if required.

Author:
Stephen Colebourne

Constructor Summary
SAXOutputter()
          Constructor
SAXOutputter(XMLMetaData metaData)
          Constructor
 
Method Summary
 XMLMetaData getMetaData()
          Gets the metadata for XML output.
 void output(java.lang.Object bean, org.xml.sax.ContentHandler handler)
          Output a Bean as SAX events.
 void output(java.lang.Object bean, java.lang.String rootName, org.xml.sax.ContentHandler handler)
          Output a Bean as SAX events specifying the name for the root element.
protected  void outputBean(org.xml.sax.ContentHandler handler, XMLConvertorContext context, java.lang.Object bean, XMLData data)
          Outputs the whole of a single object.
protected  void outputChildren(org.xml.sax.ContentHandler handler, XMLConvertorContext context, XMLData data)
          Output the children of an XMLData.
protected  void sendCharacters(org.xml.sax.ContentHandler handler, java.lang.String text)
          Event sent to when character data is found.
protected  void sendDocumentLocator(org.xml.sax.ContentHandler handler)
          Event sent to indicate the line of the XML file.
protected  void sendEndDocument(org.xml.sax.ContentHandler handler)
          Event sent to indicate the end of the document.
protected  void sendEndElement(org.xml.sax.ContentHandler handler, XMLName name)
          Event sent to indicate the end tag of an element.
protected  void sendStartDocument(org.xml.sax.ContentHandler handler)
          Event sent to indicate the start of the document.
protected  void sendStartElement(org.xml.sax.ContentHandler handler, XMLName name, org.xml.sax.Attributes saxAttrs)
          Event sent to indicate the start tag of an element.
 void setMetaData(XMLMetaData metaData)
          Sets the metaData for XML output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXOutputter

public SAXOutputter()
Constructor


SAXOutputter

public SAXOutputter(XMLMetaData metaData)
Constructor

Parameters:
metaData - the metaData to control the output
Method Detail

getMetaData

public XMLMetaData getMetaData()
Gets the metadata for XML output.

Returns:
the metadata

setMetaData

public void setMetaData(XMLMetaData metaData)
Sets the metaData for XML output.

Parameters:
metaData - the metaData to use

output

public void output(java.lang.Object bean,
                   org.xml.sax.ContentHandler handler)
            throws org.xml.sax.SAXException
Output a Bean as SAX events.

Parameters:
bean - the bean to output
handler - the SAX handler to output to
org.xml.sax.SAXException

output

public void output(java.lang.Object bean,
                   java.lang.String rootName,
                   org.xml.sax.ContentHandler handler)
            throws org.xml.sax.SAXException
Output a Bean as SAX events specifying the name for the root element.

Parameters:
bean - the bean to output
handler - the SAX handler to output to
org.xml.sax.SAXException

outputBean

protected void outputBean(org.xml.sax.ContentHandler handler,
                          XMLConvertorContext context,
                          java.lang.Object bean,
                          XMLData data)
                   throws org.xml.sax.SAXException
Outputs the whole of a single object. The object should generally be a bean, not a List/Map/base type etc,

Parameters:
context - the current output context
bean - the bean to output
data - the XMLData for this bean
org.xml.sax.SAXException

outputChildren

protected void outputChildren(org.xml.sax.ContentHandler handler,
                              XMLConvertorContext context,
                              XMLData data)
                       throws org.xml.sax.SAXException
Output the children of an XMLData.

Parameters:
context - the current output context
data - the XMLData to output
org.xml.sax.SAXException

sendDocumentLocator

protected void sendDocumentLocator(org.xml.sax.ContentHandler handler)
                            throws org.xml.sax.SAXException
Event sent to indicate the line of the XML file. This has no meaning here, but we send it anyway.

org.xml.sax.SAXException

sendStartDocument

protected void sendStartDocument(org.xml.sax.ContentHandler handler)
                          throws org.xml.sax.SAXException
Event sent to indicate the start of the document.

org.xml.sax.SAXException

sendEndDocument

protected void sendEndDocument(org.xml.sax.ContentHandler handler)
                        throws org.xml.sax.SAXException
Event sent to indicate the end of the document.

org.xml.sax.SAXException

sendStartElement

protected void sendStartElement(org.xml.sax.ContentHandler handler,
                                XMLName name,
                                org.xml.sax.Attributes saxAttrs)
                         throws org.xml.sax.SAXException
Event sent to indicate the start tag of an element.

Parameters:
name - the name of the element
saxAttrs - the non-null sax attributes
org.xml.sax.SAXException

sendEndElement

protected void sendEndElement(org.xml.sax.ContentHandler handler,
                              XMLName name)
                       throws org.xml.sax.SAXException
Event sent to indicate the end tag of an element.

Parameters:
name - the name of the element
org.xml.sax.SAXException

sendCharacters

protected void sendCharacters(org.xml.sax.ContentHandler handler,
                              java.lang.String text)
                       throws org.xml.sax.SAXException
Event sent to when character data is found.

Parameters:
text - the text to send
org.xml.sax.SAXException

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.