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 lineIndent) |
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
XMLWriter.startElement(String)
addAttribute
in interface XMLWriter
public void setEncoding(String encoding)
XMLWriter
setEncoding
in interface XMLWriter
encoding
- the encodingpublic void setDocType(String docType)
XMLWriter
setDocType
in interface XMLWriter
docType
- the docTypepublic void setLineSeparator(String lineSeparator)
public void setLineIndenter(String lineIndent)
public void startElement(String elementName)
XMLWriter
startElement
in interface XMLWriter
public void writeText(String text)
XMLWriter
public void writeMarkup(String markup)
XMLWriter
writeMarkup
in interface XMLWriter
public void endElement()
XMLWriter
endElement
in interface XMLWriter
XMLWriter.startElement(String)
Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.