public class SAXBeanWriter extends AbstractBeanWriter
Modifier and Type | Field and Description |
---|---|
private AttributesImpl |
attributes
Current element's attributes.
|
private ContentHandler |
contentHandler
Where the output goes
|
private Stack |
elementStack
Place holder for elements that are started.
|
private boolean |
elementWaiting
Is there a element currently waiting to be written out?
|
private Log |
log
Log used for logging (Doh!)
|
Constructor and Description |
---|
SAXBeanWriter(ContentHandler contentHandler)
Constructor sets writer used for output.
|
Modifier and Type | Method and Description |
---|---|
void |
end()
This method will announce the end of the document to
the contenthandler.
|
protected void |
expressAttribute(String qualifiedName,
String value)
Express an attribute
|
protected void |
expressBodyText(String text)
Express body text
|
protected void |
expressElementEnd()
Express an empty element end
|
protected void |
expressElementEnd(String qualifiedName)
Express an element end tag
|
protected void |
expressElementStart(String qualifiedName)
Express an element tag start using given qualified name
|
protected void |
expressTagClose()
Element end
|
Log |
getLog()
Set the log implementation used.
|
private void |
sendElementStart()
Send the start element event to the
ContentHandler |
void |
setLog(Log log)
Set the log implementation used.
|
void |
start()
This will announce the start of the document
to the contenthandler.
|
getAbstractBeanWriterLog, getIdGenerator, getIndentLevel, getWriteIDs, getXMLIntrospector, popBean, pushBean, setAbstractBeanWriterLog, setIdGenerator, setWriteIDs, setXMLIntrospector, write, write, write, write, writeAttribute, writeAttributes, writeContent, writeIDREFElement, writeIndent, writePrintln, writeRestOfElement
private ContentHandler contentHandler
private Log log
private Stack elementStack
private AttributesImpl attributes
private boolean elementWaiting
public SAXBeanWriter(ContentHandler contentHandler)
Constructor sets writer used for output.
contentHandler
- feed events to this content handlerpublic Log getLog()
Set the log implementation used.
Log
implementation that this class logs topublic void setLog(Log log)
Set the log implementation used.
log
- Log
implementation to useprotected void expressElementStart(String qualifiedName) throws SAXException
expressElementStart
in class AbstractBeanWriter
qualifiedName
- the fully qualified element nameSAXException
- if the ContentHandler
has a problemprotected void expressTagClose()
expressTagClose
in class AbstractBeanWriter
protected void expressElementEnd(String qualifiedName) throws SAXException
expressElementEnd
in class AbstractBeanWriter
qualifiedName
- the fully qualified name of the elementSAXException
- if the ContentHandler
has a problemprotected void expressElementEnd() throws SAXException
expressElementEnd
in class AbstractBeanWriter
SAXException
- if the ContentHandler
has a problemprotected void expressBodyText(String text) throws SAXException
expressBodyText
in class AbstractBeanWriter
text
- the element body textSAXException
- if the ContentHandler
has a problemprotected void expressAttribute(String qualifiedName, String value) throws SAXException
expressAttribute
in class AbstractBeanWriter
qualifiedName
- the fully qualified attribute namevalue
- the attribute valueSAXException
- if the ContentHandler
has a problemprivate void sendElementStart() throws SAXException
ContentHandler
SAXException
- if the ContentHandler
has a problempublic void start() throws SAXException
start
in class AbstractBeanWriter
SAXException
- if an SAX problem occurs during writingAbstractBeanWriter.end()
public void end() throws SAXException
end
in class AbstractBeanWriter
SAXException
- if an SAX problem occurs during writingAbstractBeanWriter.start()