groovy.util
Class XmlNodePrinter
java.lang.Object
groovy.util.XmlNodePrinter
- Direct Known Subclasses:
- XmlTemplateEngine.GspPrinter
public class XmlNodePrinter
- extends java.lang.Object
Prints a node with all children in XML format.
- Author:
- Christian Stein
- See Also:
NodePrinter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
protected final IndentPrinter out
quote
private java.lang.String quote
namespaceAware
private boolean namespaceAware
XmlNodePrinter
public XmlNodePrinter(java.io.PrintWriter out)
XmlNodePrinter
public XmlNodePrinter(java.io.PrintWriter out,
java.lang.String indent)
XmlNodePrinter
public XmlNodePrinter(java.io.PrintWriter out,
java.lang.String indent,
java.lang.String quote)
XmlNodePrinter
public XmlNodePrinter(IndentPrinter out,
java.lang.String quote)
XmlNodePrinter
public XmlNodePrinter()
getNameOfNode
public java.lang.String getNameOfNode(Node node)
isEmptyElement
public boolean isEmptyElement(Node node)
print
public void print(Node node)
isNamespaceAware
public boolean isNamespaceAware()
- Check if namespace handling is enabled.
- Returns:
- true if namespace handling is enabled
setNamespaceAware
public void setNamespaceAware(boolean namespaceAware)
- Enable and/or disable namespace handling.
- Parameters:
namespaceAware
- the new desired value
getQuote
public java.lang.String getQuote()
- Get Quote to use when printing attributes.
- Returns:
- the quote character
setQuote
public void setQuote(java.lang.String quote)
- Set Quote to use when printing attributes.
- Parameters:
quote
- the quote character
print
protected void print(Node node,
XmlNodePrinter.NamespaceContext ctx)
printLineBegin
protected void printLineBegin()
printLineEnd
protected void printLineEnd()
printLineEnd
protected void printLineEnd(java.lang.String comment)
printList
protected void printList(java.util.List list,
XmlNodePrinter.NamespaceContext ctx)
printSimpleItemWithIndent
private void printSimpleItemWithIndent(java.lang.Object value)
printSimpleItem
protected void printSimpleItem(java.lang.Object value)
printName
protected void printName(Node node,
XmlNodePrinter.NamespaceContext ctx,
boolean begin)
printNameAttributes
protected void printNameAttributes(java.util.Map attributes)
printSpecialNode
protected boolean printSpecialNode(Node node)
printNamespace
protected void printNamespace(Node node,
XmlNodePrinter.NamespaceContext ctx)
Copyright © ${year} The Codehaus. All Rights Reserved.