|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.util.XmlNodePrinter
public class XmlNodePrinter
Prints a node with all children in XML format.
NodePrinter
Nested Class Summary | |
---|---|
protected class |
XmlNodePrinter.NamespaceContext
|
Field Summary | |
---|---|
private boolean |
namespaceAware
|
protected IndentPrinter |
out
|
private boolean |
preserveWhitespace
|
private java.lang.String |
quote
|
Constructor Summary | |
---|---|
XmlNodePrinter()
|
|
XmlNodePrinter(IndentPrinter out)
|
|
XmlNodePrinter(IndentPrinter out,
java.lang.String quote)
|
|
XmlNodePrinter(java.io.PrintWriter out)
|
|
XmlNodePrinter(java.io.PrintWriter out,
java.lang.String indent)
|
|
XmlNodePrinter(java.io.PrintWriter out,
java.lang.String indent,
java.lang.String quote)
|
Method Summary | |
---|---|
private java.lang.String |
getName(java.lang.Object object)
|
java.lang.String |
getQuote()
Get Quote to use when printing attributes. |
private boolean |
isEmptyElement(Node node)
|
private boolean |
isListOfSimple(java.util.List value)
|
boolean |
isNamespaceAware()
Check if namespace handling is enabled. |
boolean |
isPreserveWhitespace()
Check if whitespace preservation is enabled. |
void |
print(Node node)
|
protected void |
print(Node node,
XmlNodePrinter.NamespaceContext ctx)
|
private void |
printEscaped(java.lang.String s)
|
protected void |
printLineBegin()
|
protected void |
printLineEnd()
|
protected void |
printLineEnd(java.lang.String comment)
|
protected void |
printList(java.util.List list,
XmlNodePrinter.NamespaceContext ctx)
|
protected void |
printName(Node node,
XmlNodePrinter.NamespaceContext ctx,
boolean begin,
boolean preserve)
|
protected void |
printNameAttributes(java.util.Map attributes,
XmlNodePrinter.NamespaceContext ctx)
|
protected void |
printNamespace(java.lang.Object object,
XmlNodePrinter.NamespaceContext ctx)
|
protected void |
printSimpleItem(java.lang.Object value)
|
private void |
printSimpleItemWithIndent(java.lang.Object value)
|
protected boolean |
printSpecialNode(Node node)
|
void |
setNamespaceAware(boolean namespaceAware)
Enable and/or disable namespace handling. |
void |
setPreserveWhitespace(boolean preserveWhitespace)
Enable and/or disable preservation of whitespace. |
void |
setQuote(java.lang.String quote)
Set Quote to use when printing attributes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IndentPrinter out
private java.lang.String quote
private boolean namespaceAware
private boolean preserveWhitespace
Constructor Detail |
---|
public XmlNodePrinter(java.io.PrintWriter out)
public XmlNodePrinter(java.io.PrintWriter out, java.lang.String indent)
public XmlNodePrinter(java.io.PrintWriter out, java.lang.String indent, java.lang.String quote)
public XmlNodePrinter(IndentPrinter out)
public XmlNodePrinter(IndentPrinter out, java.lang.String quote)
public XmlNodePrinter()
Method Detail |
---|
public void print(Node node)
public boolean isNamespaceAware()
true
.
public void setNamespaceAware(boolean namespaceAware)
namespaceAware
- the new desired valuepublic boolean isPreserveWhitespace()
false
.
public void setPreserveWhitespace(boolean preserveWhitespace)
preserveWhitespace
- the new desired valuepublic java.lang.String getQuote()
public void setQuote(java.lang.String quote)
quote
- the quote characterprotected void print(Node node, XmlNodePrinter.NamespaceContext ctx)
private boolean isListOfSimple(java.util.List value)
protected void printLineBegin()
protected void printLineEnd()
protected void printLineEnd(java.lang.String comment)
protected void printList(java.util.List list, XmlNodePrinter.NamespaceContext ctx)
protected void printSimpleItem(java.lang.Object value)
protected void printName(Node node, XmlNodePrinter.NamespaceContext ctx, boolean begin, boolean preserve)
protected boolean printSpecialNode(Node node)
protected void printNamespace(java.lang.Object object, XmlNodePrinter.NamespaceContext ctx)
protected void printNameAttributes(java.util.Map attributes, XmlNodePrinter.NamespaceContext ctx)
private boolean isEmptyElement(Node node)
private java.lang.String getName(java.lang.Object object)
private void printSimpleItemWithIndent(java.lang.Object value)
private void printEscaped(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |