public class DomSerializer extends Object implements XmlSerializer
Constructor and Description |
---|
DomSerializer(DOMResult domResult) |
DomSerializer(Node node) |
Modifier and Type | Method and Description |
---|---|
void |
beginStartTag(String uri,
String localName,
String prefix)
Begins writing a start tag.
|
void |
cdata(StringBuilder text)
Writes CDATA.
|
void |
comment(StringBuilder comment)
Writes a comment.
|
void |
endDocument()
The last method to be called.
|
void |
endStartTag(String uri,
String localName,
String prefix)
Completes the start tag.
|
void |
endTag()
Writes an end tag.
|
void |
flush()
Flush the buffer.
|
void |
startDocument()
The first method to be called.
|
void |
text(StringBuilder text)
Writes PCDATA.
|
void |
writeAttribute(String uri,
String localName,
String prefix,
StringBuilder value)
Writes an attribute.
|
void |
writeXmlns(String prefix,
String uri)
Writes a namespace declaration.
|
public DomSerializer(Node node)
public DomSerializer(DOMResult domResult)
public void startDocument()
XmlSerializer
startDocument
in interface XmlSerializer
public void beginStartTag(String uri, String localName, String prefix)
XmlSerializer
beginStartTag
in interface XmlSerializer
uri
- the namespace URI of the element. Can be empty but never be null.prefix
- the prefix that should be used for this element. Can be empty,
but never null.public void writeAttribute(String uri, String localName, String prefix, StringBuilder value)
XmlSerializer
writeAttribute
in interface XmlSerializer
uri
- the namespace URI of the attribute. Can be empty but never be null.prefix
- the prefix that should be used for this attribute. Can be empty,
but never null.value
- The value of the attribute. It's the callee's responsibility to
escape special characters (such as <, >, and &) in this buffer.public void writeXmlns(String prefix, String uri)
XmlSerializer
writeXmlns
in interface XmlSerializer
prefix
- the prefix that is allocated. Can be empty but never be null.uri
- the namespace URI to be declared. Can be empty but never be null.public void endStartTag(String uri, String localName, String prefix)
XmlSerializer
endStartTag
in interface XmlSerializer
uri
- the namespace URI of the element. Can be empty but never be null.prefix
- the prefix that should be used for this element. Can be empty,
but never null.public void endTag()
XmlSerializer
endTag
in interface XmlSerializer
public void text(StringBuilder text)
XmlSerializer
text
in interface XmlSerializer
text
- The character data to be written. It's the callee's responsibility to
escape special characters (such as <, >, and &) in this buffer.public void cdata(StringBuilder text)
XmlSerializer
cdata
in interface XmlSerializer
public void comment(StringBuilder comment)
XmlSerializer
comment
in interface XmlSerializer
public void endDocument()
XmlSerializer
endDocument
in interface XmlSerializer
public void flush()
XmlSerializer
TypedXmlWriter.commit(boolean)
method. If the implementation performs any buffering, it should flush the buffer.flush
in interface XmlSerializer
Copyright © 2021 JBoss by Red Hat. All rights reserved.