public class

SAXBeanWriter

extends AbstractBeanWriter
java.lang.Object
   ↳ org.apache.commons.betwixt.io.AbstractBeanWriter
     ↳ org.apache.commons.betwixt.io.SAXBeanWriter

Class Overview

The SAXBeanwriter will send events to a ContentHandler

Summary

Public Constructors
SAXBeanWriter(ContentHandler contentHandler)

Constructor sets writer used for output.

Public Methods
void end()
This method will announce the end of the document to the contenthandler.
boolean getCallDocumentEvents()
Should document events (ie start and end) be called?
Log getLog()

Set the log implementation used.

void setCallDocumentEvents(boolean callDocumentEvents)
Sets whether the document events (ie start and end) should be called.
void setLog(Log log)

Set the log implementation used.

void start()
This will announce the start of the document to the contenthandler.
Protected Methods
void bodyText(WriteContext context, String text)
Express body text
void endElement(WriteContext context, String uri, String localName, String qName)
Writes the end tag for an element
void startElement(WriteContext context, String uri, String localName, String qName, Attributes attributes)
Writes the start tag for an element.
[Expand]
Inherited Methods
From class org.apache.commons.betwixt.io.AbstractBeanWriter
From class java.lang.Object

Public Constructors

public SAXBeanWriter (ContentHandler contentHandler)

Constructor sets writer used for output.

Parameters
contentHandler feed events to this content handler

Public Methods

public void end ()

This method will announce the end of the document to the contenthandler.

Throws
SAXException
See Also

public boolean getCallDocumentEvents ()

Should document events (ie start and end) be called?

Returns
  • true if this SAXWriter should call start and end of the content handler

public Log getLog ()

Set the log implementation used.

Returns
  • Log implementation that this class logs to

public void setCallDocumentEvents (boolean callDocumentEvents)

Sets whether the document events (ie start and end) should be called.

Parameters
callDocumentEvents should document events be called

public void setLog (Log log)

Set the log implementation used.

Parameters
log Log implementation to use

public void start ()

This will announce the start of the document to the contenthandler.

Throws
SAXException
See Also

Protected Methods

protected void bodyText (WriteContext context, String text)

Express body text

Parameters
text the element body text
Throws
SAXException if the ContentHandler has a problem

protected void endElement (WriteContext context, String uri, String localName, String qName)

Writes the end tag for an element

Parameters
uri the element's namespace uri
localName the element's local name
qName the element's qualified name
Throws
SAXException if an SAX problem occurs during writing

protected void startElement (WriteContext context, String uri, String localName, String qName, Attributes attributes)

Writes the start tag for an element.

Parameters
uri the element's namespace uri
localName the element's local name
qName the element's qualified name
attributes the element's attributes
Throws
SAXException if an SAX problem occurs during writing