public class SAXToXMLWriter extends Object
SAXElement
to XML writer class.
This class encapsulates the writing of SAXElement
content as XML. It allows
writing of start, end and text parts of an element to a supplied Writer
, or to the
Writer
associated with any StreamResult
that may have been supplied in
one of the Smooks.filterSource()
method.
If you want to write text events with any of the writeText
methods, you need to annotate the SAXVisitor
instance provided in the constructor
with the @TextConsumer
Annotation.Constructor and Description |
---|
SAXToXMLWriter(SAXVisitor owner,
boolean encodeSpecialChars)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
writeEmptyElement(SAXElement element)
Write the element as an empty (closed) element to any
StreamResult instance that may have been supplied to the
Smooks.filterSource()
method. |
void |
writeEmptyElement(SAXElement element,
Writer writer)
Write the element as an empty (closed) element to the supplied
Writer . |
void |
writeEndElement(SAXElement element)
Write the element end to any
StreamResult instance that may have been supplied to the
Smooks.filterSource()
method. |
void |
writeEndElement(SAXElement element,
Writer writer)
Write the element end to the supplied
Writer . |
void |
writeStartElement(SAXElement element)
Write the element start to any
StreamResult instance that may have been supplied to the
Smooks.filterSource()
method. |
void |
writeStartElement(SAXElement element,
Writer writer)
Write the element start to the supplied writer instance.
|
void |
writeText(SAXElement element)
Write the element text to any
StreamResult instance that may have been supplied to the
Smooks.filterSource()
method. |
void |
writeText(SAXElement element,
Writer writer)
Write the element text to the supplied
Writer instance. |
void |
writeText(SAXText text,
SAXElement associatedElement)
Write the text event content to any
StreamResult instance that may have been supplied to the
Smooks.filterSource()
method. |
void |
writeText(SAXText text,
Writer writer)
Write the text event content to the supplied
Writer instance. |
void |
writeText(String text,
SAXElement associatedElement)
Write the text content to any
StreamResult instance that may have been supplied to the
Smooks.filterSource()
method. |
void |
writeText(String text,
Writer writer)
Write the text content to the supplied
Writer . |
public SAXToXMLWriter(SAXVisitor owner, boolean encodeSpecialChars)
owner
- The owning SAXVisitor
instance.encodeSpecialChars
- Encode special XML characters.public void writeStartElement(SAXElement element, Writer writer) throws IOException
element
- The element.writer
- The writer.IOException
- Exception writing.public void writeStartElement(SAXElement element) throws IOException
StreamResult
instance that may have been supplied to the
Smooks.filterSource()
method.element
- The element.IOException
- Exception writing.public void writeEndElement(SAXElement element, Writer writer) throws IOException
Writer
.element
- The element.writer
- The Writer.IOException
- Exception writing.public void writeEndElement(SAXElement element) throws IOException
StreamResult
instance that may have been supplied to the
Smooks.filterSource()
method.element
- The element.IOException
- Exception writing.public void writeText(SAXElement element, Writer writer) throws IOException
Writer
instance.
See about writing text.element
- The element.writer
- The Writer.IOException
- Exception writing.public void writeText(SAXElement element) throws IOException
StreamResult
instance that may have been supplied to the
Smooks.filterSource()
method.
See about writing text.element
- The element.IOException
- Exception writing.public void writeText(SAXText text, Writer writer) throws IOException
Writer
instance.text
- The SAXText event.writer
- The Writer.IOException
- Exception writing.public void writeText(SAXText text, SAXElement associatedElement) throws IOException
StreamResult
instance that may have been supplied to the
Smooks.filterSource()
method.text
- The SAXText event.associatedElement
- The associated element (fragment) of the SAXText event.IOException
- Exception writing.public void writeText(String text, Writer writer) throws IOException
Writer
.text
- The text.writer
- The Writer.IOException
- Exception writing.public void writeText(String text, SAXElement associatedElement) throws IOException
StreamResult
instance that may have been supplied to the
Smooks.filterSource()
method.text
- The text.associatedElement
- The associated element (fragment) of the text.IOException
- Exception writing.public void writeEmptyElement(SAXElement element, Writer writer) throws IOException
Writer
.element
- The element.writer
- The Writer.IOException
- Exception writing.public void writeEmptyElement(SAXElement element) throws IOException
StreamResult
instance that may have been supplied to the
Smooks.filterSource()
method.element
- The element.IOException
- Exception writing.Copyright © 2020. All rights reserved.