public interface SaxWriter
SaxWriter
is similar to a SAX ContentHandler
which, perversely, converts its events into an output document.Modifier and Type | Method and Description |
---|---|
void |
characters(String data) |
void |
completeBeforeElement(String tagName) |
void |
element(String name,
Object... attrs) |
void |
endDocument() |
void |
endElement() |
void |
endSequence()
Informs the writer that a sequence of elements of the same name has
ended.
|
void |
flush()
Flushes any unwritten output.
|
void |
startDocument() |
void |
startElement(String name) |
void |
startElement(String name,
Object... attrs) |
void |
startSequence(String name,
String subName)
Informs the writer that a sequence of elements of the same name is
starting.
|
void |
textElement(String name,
Object data)
Generates a text-only element,
<name>data</name> . |
void |
verbatim(String text)
Sends a piece of text verbatim through the writer.
|
void startDocument()
void endDocument()
void startElement(String name)
void endElement()
void characters(String data)
void startSequence(String name, String subName)
For XML, is equivalent to startElement(name)
.
For JSON, initiates the array construct:
"name" : [
{ ... },
{ ... }
]
name
- Element namesubName
- Child element namevoid endSequence()
void textElement(String name, Object data)
<name>data</name>
.
For XML, this is equivalent to
startElement(name);
characters(data);
endElement();
but for JSON, generates "name": "data"
.name
- Name of elementdata
- Text content of elementvoid completeBeforeElement(String tagName)
void verbatim(String text)
void flush()
Copyright © 2020 Hitachi Vantara. All rights reserved.