org.codehaus.plexus.util.xml
public class PrettyPrintXMLWriter extends Object implements XMLWriter
Version: $Id: PrettyPrintXMLWriter.java 5958 2007-02-28 10:29:55Z olamy $
Field Summary | |
---|---|
int | depth |
String | docType |
LinkedList | elementStack |
String | encoding |
String | lineIndenter |
static String | LS |
boolean | readyForNewLine |
boolean | tagInProgress |
boolean | tagIsEmpty |
PrintWriter | writer |
Constructor Summary | |
---|---|
PrettyPrintXMLWriter(PrintWriter writer, String lineIndenter) | |
PrettyPrintXMLWriter(Writer writer, String lineIndenter) | |
PrettyPrintXMLWriter(PrintWriter writer) | |
PrettyPrintXMLWriter(Writer writer) | |
PrettyPrintXMLWriter(PrintWriter writer, String lineIndenter, String encoding, String doctype) | |
PrettyPrintXMLWriter(Writer writer, String lineIndenter, String encoding, String doctype) | |
PrettyPrintXMLWriter(PrintWriter writer, String encoding, String doctype) | |
PrettyPrintXMLWriter(Writer writer, String encoding, String doctype) |
Method Summary | |
---|---|
void | addAttribute(String key, String value) |
void | endElement() |
protected void | endOfLine()
Write the end of line character (using system line separator)
and start new line with indentation |
static String | escapeXml(String text) |
static String | escapeXmlAttribute(String text) |
void | finishTag() |
protected int | getDepth()
Get the current depth in the xml indentation |
protected String | getDocType() |
protected String | getEncoding() |
protected String | getLineIndenter()
Get the string used as line indenter |
protected PrintWriter | getWriter()
Get the underlying writer |
protected void | setDepth(int depth)
Set the current depth in the xml indentation |
protected void | setDocType(String docType) |
protected void | setEncoding(String encoding) |
protected void | setLineIndenter(String lineIndenter)
Set the string used as line indenter |
protected void | setWriter(PrintWriter writer)
Set the underlying writer |
void | startElement(String name) |
void | write(String str)
Write a string to the underlying writer |
void | writeDocumentHeaders() |
void | writeMarkup(String text) |
void | writeText(String text) |
void | writeText(String text, boolean escapeXml) |
Returns:
Returns: the line indenter
Returns: the underlying writer
Parameters: depth
Parameters: lineIndenter
Parameters: writer
Parameters: str