Constructor and Description |
---|
PrettyPrintXMLWriter(PrintWriter writer) |
PrettyPrintXMLWriter(PrintWriter writer,
String lineIndent) |
PrettyPrintXMLWriter(PrintWriter writer,
String encoding,
String doctype) |
PrettyPrintXMLWriter(PrintWriter writer,
String lineIndent,
String encoding,
String doctype) |
PrettyPrintXMLWriter(PrintWriter writer,
String lineIndent,
String lineSeparator,
String encoding,
String doctype) |
PrettyPrintXMLWriter(Writer writer) |
PrettyPrintXMLWriter(Writer writer,
String lineIndent) |
PrettyPrintXMLWriter(Writer writer,
String encoding,
String doctype) |
PrettyPrintXMLWriter(Writer writer,
String lineIndent,
String encoding,
String doctype) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String key,
String value)
Add a XML attribute to the current XML Element.
|
void |
endElement()
End the previously opened element.
|
void |
setDocType(String docType)
Sets the docType of the document.
|
void |
setEncoding(String encoding)
Sets the encoding of the document.
|
void |
setLineIndenter(String lineIndentParameter) |
void |
setLineSeparator(String lineSeparator) |
void |
startElement(String elementName)
Start an XML Element tag.
|
void |
writeMarkup(String markup)
Add a preformatted markup to the current element tag
|
void |
writeText(String text)
Add a value text to the current element tag
This will perform XML escaping to guarantee valid content
|
public PrettyPrintXMLWriter(PrintWriter writer, String lineIndent)
writer
- not nulllineIndent
- could be null, but the normal way is some spaces.public PrettyPrintXMLWriter(Writer writer, String lineIndent)
writer
- not nulllineIndent
- could be null, but the normal way is some spaces.public PrettyPrintXMLWriter(PrintWriter writer)
writer
- not nullpublic PrettyPrintXMLWriter(Writer writer)
writer
- not nullpublic PrettyPrintXMLWriter(PrintWriter writer, String lineIndent, String encoding, String doctype)
writer
- not nulllineIndent
- could be null, but the normal way is some spaces.encoding
- could be null or invalid.doctype
- could be null.public PrettyPrintXMLWriter(Writer writer, String lineIndent, String encoding, String doctype)
writer
- not nulllineIndent
- could be null, but the normal way is some spaces.encoding
- could be null or invalid.doctype
- could be null.public PrettyPrintXMLWriter(PrintWriter writer, String encoding, String doctype)
writer
- not nullencoding
- could be null or invalid.doctype
- could be null.public PrettyPrintXMLWriter(Writer writer, String encoding, String doctype)
writer
- not nullencoding
- could be null or invalid.doctype
- could be null.public PrettyPrintXMLWriter(PrintWriter writer, String lineIndent, String lineSeparator, String encoding, String doctype)
writer
- not nulllineIndent
- could be null, but the normal way is some spaces.lineSeparator
- could be null, but the normal way is valid line separatorencoding
- could be null or the encoding to use.doctype
- could be null.public void addAttribute(String key, String value)
XMLWriter.startElement(String)
addAttribute
in interface XMLWriter
key
- The key of the attribute.value
- The value of the attribute.public void setEncoding(String encoding)
setEncoding
in interface XMLWriter
encoding
- the encodingpublic void setDocType(String docType)
setDocType
in interface XMLWriter
docType
- the docTypepublic void setLineSeparator(String lineSeparator)
lineSeparator
- The line separator to be used.public void setLineIndenter(String lineIndentParameter)
lineIndentParameter
- The line indent parameter.public void startElement(String elementName)
startElement
in interface XMLWriter
elementName
- The name of the tag.public void writeText(String text)
public void writeMarkup(String markup)
writeMarkup
in interface XMLWriter
markup
- The text which should be written.public void endElement()
endElement
in interface XMLWriter
XMLWriter.startElement(String)
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.