| 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) throws IOException
XMLWriter.startElement(String)addAttribute in interface XMLWriterkey - The key of the attribute.value - The value of the attribute.IOException - if adding the attribute fails.public void setEncoding(String encoding)
setEncoding in interface XMLWriterencoding - the encodingpublic void setDocType(String docType)
setDocType in interface XMLWriterdocType - 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) throws IOException
startElement in interface XMLWriterelementName - The name of the tag.IOException - if starting the element fails.public void writeText(String text) throws IOException
writeText in interface XMLWritertext - The text which should be written.IOException - if writing the text fails.public void writeMarkup(String markup) throws IOException
writeMarkup in interface XMLWritermarkup - The text which should be written.IOException - if writing the markup fails.public void endElement()
throws IOException
endElement in interface XMLWriterIOException - if ending the element fails.XMLWriter.startElement(String)Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.