Groovy 1.7.0

## groovy.util
Class XmlNodePrinter

    java.lang.Object
      groovy.util.XmlNodePrinter

    class XmlNodePrinter
    extends Object

Prints a node with all children in XML format.

author:
  Christian Stein

see:
  NodePrinter

Nested Class Summary
`class` | `XmlNodePrinter.NamespaceContext`

Field Summary
`protected IndentPrinter` | `out`

Constructor Summary
`XmlNodePrinter(PrintWriter out)`
`XmlNodePrinter(PrintWriter out, String indent)`
`XmlNodePrinter(PrintWriter out, String indent, String quote)`
`XmlNodePrinter(IndentPrinter out)`
`XmlNodePrinter(IndentPrinter out, String quote)`
`XmlNodePrinter()`

Method Summary
`String` | `getQuote()` Get Quote to use when printing attributes.
`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, NamespaceContext ctx)`
`protected void` | `printLineBegin()`
`protected void` | `printLineEnd()`
`protected void` | `printLineEnd(String comment)`
`protected void` | `printList(List list, NamespaceContext ctx)`
`protected void` | `printName(Node node, NamespaceContext ctx, boolean begin, boolean preserve)`
`protected void` | `printNameAttributes(Map attributes, NamespaceContext ctx)`
`protected void` | `printNamespace(Object object, NamespaceContext ctx)`
`protected void` | `printSimpleItem(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(String quote)` Set Quote to use when printing attributes.

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Field Detail

### out

    protected final IndentPrinter out

Constructor Detail

### XmlNodePrinter

    public XmlNodePrinter(PrintWriter out)

### XmlNodePrinter

    public XmlNodePrinter(PrintWriter out, String indent)

### XmlNodePrinter

    public XmlNodePrinter(PrintWriter out, String indent, String quote)

### XmlNodePrinter

    public XmlNodePrinter(IndentPrinter out)

### XmlNodePrinter

    public XmlNodePrinter(IndentPrinter out, String quote)

### XmlNodePrinter

    public XmlNodePrinter()

Method Detail

### getQuote

    public String getQuote()

  Get Quote to use when printing attributes.
  return:
    the quote character

### isNamespaceAware

    public boolean isNamespaceAware()

  Check if namespace handling is enabled. Defaults to `true`.
  return:
    true if namespace handling is enabled

### isPreserveWhitespace

    public boolean isPreserveWhitespace()

  Check if whitespace preservation is enabled. Defaults to `false`.
  return:
    true if whitespaces are honoured when printing simple text nodes

### print

    public void print(Node node)

### print

    protected void print(Node node, NamespaceContext ctx)

### printLineBegin

    protected void printLineBegin()

### printLineEnd

    protected void printLineEnd()

### printLineEnd

    protected void printLineEnd(String comment)

### printList

    protected void printList(List list, NamespaceContext ctx)

### printName

    protected void printName(Node node, NamespaceContext ctx, boolean begin, boolean preserve)

### printNameAttributes

    protected void printNameAttributes(Map attributes, NamespaceContext ctx)

### printNamespace

    protected void printNamespace(Object object, NamespaceContext ctx)

### printSimpleItem

    protected void printSimpleItem(Object value)

### printSpecialNode

    protected boolean printSpecialNode(Node node)

### setNamespaceAware

    public void setNamespaceAware(boolean namespaceAware)

  Enable and/or disable namespace handling.
  param:
    namespaceAware the new desired value

### setPreserveWhitespace

    public void setPreserveWhitespace(boolean preserveWhitespace)

  Enable and/or disable preservation of whitespace.
  param:
    preserveWhitespace the new desired value

### setQuote

    public void setQuote(String quote)

  Set Quote to use when printing attributes.
  param:
    quote the quote character

Copyright © 2003-2009 The Codehaus. All rights reserved.