Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.util
Class XMLEncoder

    java.lang.Object
      org.apache.cayenne.util.XMLEncoder

    public class XMLEncoder

extends Object

A helper class to encode objects to XML.

Since:
  1.1

Field Summary
`protected String` | `indent`
`protected boolean` | `indentLine`
`protected int` | `indentTimes`
`protected PrintWriter` | `out`

Constructor Summary
`XMLEncoder(PrintWriter out)`
`XMLEncoder(PrintWriter out, String indent)`

Method Summary
`PrintWriter` | `getPrintWriter()`
`void` | `indent(int i)`
`void` | `print(boolean b)`
`void` | `print(char c)`
`void` | `print(Collection c)` Utility method that prints all map values, assuming they are XMLSerializable objects.
`void` | `print(int i)`
`void` | `print(Map map)` Utility method that prints all map values, assuming they are XMLSerializable objects.
`void` | `print(String text)`
`void` | `println(char c)`
`void` | `println(String text)`
`void` | `printProperty(String name, boolean b)` Prints a common XML element - property with name and value.
`void` | `printProperty(String name, int i)` Prints a common XML element - property with name and value.
`void` | `printProperty(String name, String value)` Prints a common XML element - property with name and value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### indent

    protected String indent

### out

    protected PrintWriter out

### indentLine

    protected boolean indentLine

### indentTimes

    protected int indentTimes

Constructor Detail

### XMLEncoder

    public XMLEncoder(PrintWriter out)

### XMLEncoder

    public XMLEncoder(PrintWriter out,
                      String indent)

Method Detail

### getPrintWriter

    public PrintWriter getPrintWriter()

### indent

    public void indent(int i)

### print

    public void print(Map map)

  Utility method that prints all map values, assuming they are XMLSerializable objects.

### print

    public void print(Collection c)

  Utility method that prints all map values, assuming they are XMLSerializable objects.

### printProperty

    public void printProperty(String name,
                              String value)

  Prints a common XML element - property with name and value.

### printProperty

    public void printProperty(String name,
                              boolean b)

  Prints a common XML element - property with name and value.

### printProperty

    public void printProperty(String name,
                              int i)

  Prints a common XML element - property with name and value.

### print

    public void print(String text)

### print

    public void print(char c)

### print

    public void print(boolean b)

### print

    public void print(int i)

### println

    public void println(String text)

### println

    public void println(char c)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.