org.apache.commons.betwixt.io
Class SAXBeanWriter

java.lang.Object
  |
  +--org.apache.commons.betwixt.io.AbstractBeanWriter
        |
        +--org.apache.commons.betwixt.io.SAXBeanWriter

public class SAXBeanWriter
extends AbstractBeanWriter

The SAXBeanwriter will send events to a ContentHandler

Version:
$Id: SAXBeanWriter.java,v 1.6 2003/01/08 22:07:21 rdonkin Exp $
Author:
Robert Burrell Donkin, Martin van den Bemt

Constructor Summary
SAXBeanWriter(org.xml.sax.ContentHandler contentHandler)
           Constructor sets writer used for output.
 
Method Summary
 void end()
          This method will announce the end of the document to the contenthandler.
protected  void expressAttribute(java.lang.String qualifiedName, java.lang.String value)
          Express an attribute
protected  void expressBodyText(java.lang.String text)
          Express body text
protected  void expressElementEnd()
          Express an empty element end
protected  void expressElementEnd(java.lang.String qualifiedName)
          Express an element end tag
protected  void expressElementStart(java.lang.String qualifiedName)
          Express an element tag start using given qualified name
protected  void expressTagClose()
          Element end
 org.apache.commons.logging.Log getLog()
           Set the log implementation used.
 void setLog(org.apache.commons.logging.Log log)
           Set the log implementation used.
 void start()
          This will announce the start of the document to the contenthandler.
 
Methods inherited from class org.apache.commons.betwixt.io.AbstractBeanWriter
getAbstractBeanWriterLog, getIdGenerator, getIndentLevel, getWriteIDs, getXMLIntrospector, popBean, pushBean, setAbstractBeanWriterLog, setIdGenerator, setWriteIDs, setXMLIntrospector, write, write, write, write, writeAttribute, writeAttributes, writeContent, writeIDREFElement, writeIndent, writePrintln, writeRestOfElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXBeanWriter

public SAXBeanWriter(org.xml.sax.ContentHandler contentHandler)

Constructor sets writer used for output.

Parameters:
contentHandler - feed events to this content handler
Method Detail

getLog

public org.apache.commons.logging.Log getLog()

Set the log implementation used.

Returns:
Log implementation that this class logs to

setLog

public void setLog(org.apache.commons.logging.Log log)

Set the log implementation used.

Parameters:
log - Log implementation to use

expressElementStart

protected void expressElementStart(java.lang.String qualifiedName)
                            throws org.xml.sax.SAXException
Express an element tag start using given qualified name
Overrides:
expressElementStart in class AbstractBeanWriter
Parameters:
qualifiedName - the fully qualified element name
Throws:
org.xml.sax.SAXException - if the ContentHandler has a problem

expressTagClose

protected void expressTagClose()
Element end
Overrides:
expressTagClose in class AbstractBeanWriter
Following copied from class: org.apache.commons.betwixt.io.AbstractBeanWriter
Throws:
java.io.IOException - if an IO problem occurs during writing
org.xml.sax.SAXException - if an SAX problem occurs during writing

expressElementEnd

protected void expressElementEnd(java.lang.String qualifiedName)
                          throws org.xml.sax.SAXException
Express an element end tag
Overrides:
expressElementEnd in class AbstractBeanWriter
Parameters:
qualifiedName - the fully qualified name of the element
Throws:
org.xml.sax.SAXException - if the ContentHandler has a problem

expressElementEnd

protected void expressElementEnd()
                          throws org.xml.sax.SAXException
Express an empty element end
Overrides:
expressElementEnd in class AbstractBeanWriter
Throws:
org.xml.sax.SAXException - if the ContentHandler has a problem

expressBodyText

protected void expressBodyText(java.lang.String text)
                        throws org.xml.sax.SAXException
Express body text
Overrides:
expressBodyText in class AbstractBeanWriter
Parameters:
text - the element body text
Throws:
org.xml.sax.SAXException - if the ContentHandler has a problem

expressAttribute

protected void expressAttribute(java.lang.String qualifiedName,
                                java.lang.String value)
                         throws org.xml.sax.SAXException
Express an attribute
Overrides:
expressAttribute in class AbstractBeanWriter
Parameters:
qualifiedName - the fully qualified attribute name
value - the attribute value
Throws:
org.xml.sax.SAXException - if the ContentHandler has a problem

start

public void start()
           throws org.xml.sax.SAXException
This will announce the start of the document to the contenthandler.
Overrides:
start in class AbstractBeanWriter
See Also:
AbstractBeanWriter.end()

end

public void end()
         throws org.xml.sax.SAXException
This method will announce the end of the document to the contenthandler.
Overrides:
end in class AbstractBeanWriter
See Also:
AbstractBeanWriter.start()


Copyright © 2002-2003 Apache Software Foundation. All Rights Reserved.