org.codehaus.plexus.util.xml
public class PrettyPrintXMLWriter extends Object implements XMLWriter
Version: $Id: PrettyPrintXMLWriter.java 8660 2010-03-05 21:50:36Z hboutemy $
Field Summary | |
---|---|
protected static String | LS Line separator ("\n" on UNIX) |
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) | |
PrettyPrintXMLWriter(PrintWriter writer, String lineIndenter, String lineSeparator, String encoding, String doctype) |
Method Summary | |
---|---|
void | addAttribute(String key, String value) |
void | endElement() |
protected void | endOfLine()
Write the end of line character (using specified line separator)
and start new line with indentation
|
protected int | getDepth()
Get the current depth in the xml indentation
|
protected String | getDocType()
Get the docType in the xml
|
protected LinkedList | getElementStack() |
protected String | getEncoding()
Get the current encoding in the xml
|
protected String | getLineIndenter()
Get the string used as line indenter
|
protected String | getLineSeparator()
Get the string used as line separator or LS if not set.
|
protected PrintWriter | getWriter()
Get the underlying writer
|
protected void | setDepth(int depth)
Set the depth in the xml indentation
|
protected void | setDocType(String docType)
Set the docType in the xml
|
protected void | setEncoding(String encoding)
Set the encoding in the xml
|
protected void | setLineIndenter(String lineIndenter)
Set the string used as line indenter
|
protected void | setLineSeparator(String lineSeparator)
Set the string used as line separator
|
protected void | setWriter(PrintWriter writer)
Set the underlying writer
|
void | startElement(String name) |
void | writeMarkup(String text) |
void | writeText(String text) |
Parameters: writer not null lineIndenter could be null, but the normal way is some spaces.
Parameters: writer not null lineIndenter could be null, but the normal way is some spaces.
Parameters: writer not null
Parameters: writer not null
Parameters: writer not null lineIndenter could be null, but the normal way is some spaces. encoding could be null or invalid. doctype could be null.
Parameters: writer not null lineIndenter could be null, but the normal way is some spaces. encoding could be null or invalid. doctype could be null.
Parameters: writer not null encoding could be null or invalid. doctype could be null.
Parameters: writer not null encoding could be null or invalid. doctype could be null.
Parameters: writer not null lineIndenter could be null, but the normal way is some spaces. lineSeparator could be null, but the normal way is valid line separator ("\n" on UNIX). encoding could be null or invalid. doctype could be null.
See Also: getLineIndenter getLineSeparator
Returns: the current depth
Returns: the current docType
Returns: the current elementStack;
Returns: the current encoding
Returns: the line indenter
Returns: the line separator
See Also: LS
Returns: the underlying writer
Parameters: depth new depth
Parameters: docType new docType
Parameters: encoding new encoding
Parameters: lineIndenter new line indenter, could be null, but the normal way is some spaces.
Parameters: lineSeparator new line separator, could be null but the normal way is valid line separator ("\n" on UNIX).
Parameters: writer not null writer