|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ssx.xml.output.sinks.TextSink
Output XML text to a java.io character stream.
Constructor Summary | |
TextSink(Writer writer,
String encoding)
Instantiate a new Xml text output with default settings |
|
TextSink(Writer writer,
String encoding,
boolean singleQuote,
boolean formatting)
Instantiate a new Xml text output with custom settings |
|
TextSink(Writer writer,
String encoding,
boolean singleQuote,
boolean formatting,
String endOfLine,
String indent)
Instantiate a new Xml text output with custom settings |
Method Summary | |
void |
close()
The user has finished providing XML. |
void |
comment(String content)
Add a comment |
void |
endElement(Namespace namespace,
String name,
List namespaceList,
boolean empty)
End an element. |
Writer |
getOutput()
|
void |
instruction(String target,
String data)
Add a processing instruction |
void |
open()
This method will be called before any other methods, after the user has provided the first xml node |
void |
startElement(Namespace namespace,
String name,
AttributeList attributes,
List namespaceList,
boolean empty)
Start a new element |
void |
text(String text)
Add character data |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextSink(Writer writer, String encoding)
writer
- The XML will be written to this streamencoding
- The character encoding that will be used for this
XML document.public TextSink(Writer writer, String encoding, boolean singleQuote, boolean formatting)
writer
- The XML will be written to this streamencoding
- The character encoding that will be used for this
XML document.singleQuote
- Use a single quote to surround attribute valuesformatting
- Format the XML output to a human readable form
using end of line markers and indented lines.public TextSink(Writer writer, String encoding, boolean singleQuote, boolean formatting, String endOfLine, String indent)
writer
- The XML will be written to this streamencoding
- The character encoding that will be used for this
XML document.singleQuote
- Use a single quote to surround attribute valuesformatting
- Format the XML output to a human readable form
using end of line markers and indented lines.endOfLine
- The marker to use at the end of lines (defaults to
CRLF)indent
- The string to use for each indent level (defaults
to 4 spaces)Method Detail |
public Writer getOutput()
public void open()
XmlSink
open
in interface XmlSink
XmlSink.open()
public void startElement(Namespace namespace, String name, AttributeList attributes, List namespaceList, boolean empty)
XmlSink
startElement
in interface XmlSink
namespace
- The element namespacename
- The element nameattributes
- The element attributesnamespaceList
- The namespaces declared in this elementempty
- True if the element contains no other nodesXmlSink.startElement(
Namespace, String, AttributeList, List, boolean)
public void text(String text)
XmlSink
text
in interface XmlSink
text
- The String to add as character dataXmlSink.text(String)
public void endElement(Namespace namespace, String name, List namespaceList, boolean empty)
XmlSink
endElement
in interface XmlSink
namespace
- The element namespacename
- The element namenamespaceList
- The namespaces that were declared in this elementempty
- True if the element contains no other nodesXmlSink.endElement(Namespace, String, List, boolean)
public void comment(String content)
XmlSink
comment
in interface XmlSink
content
- The text content of the commentXmlSink.comment(String)
public void instruction(String target, String data)
XmlSink
instruction
in interface XmlSink
target
- The PI targetdata
- The PI data - structure depends on the PIXmlSink.instruction(String, String)
public void close()
XmlSink
close
in interface XmlSink
XmlSink.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |