org.deidentifier.arx.gui.worker.io

## Class XMLWriter

- java.lang.Object
- - org.deidentifier.arx.gui.worker.io.XMLWriter

    public class XMLWriter
    extends java.lang.Object

A writer for XML documents that can handle common objects from the ARX model.

Author:
  Fabian Prasser

### Constructor Summary

Constructors
Constructor and Description
`XMLWriter()` Creates a new writer backed by a StringBuilder.
`XMLWriter(boolean compact)` Creates a new writer backed by a StringBuilder.
`XMLWriter(FileBuilder builder)` Creates a new writer backed by the given FileBuilder.
`XMLWriter(FileBuilder builder, boolean compact)` Creates a new writer backed by the given FileBuilder.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `indent(java.lang.String element)` Intend the document.
`void` `indent(java.lang.String element, java.lang.String attribute, int value)` Intend the document.
`java.lang.String` `toString()` Returns a string representation.
`void` `unindent()` Unintend.
`void` `write(java.lang.String string)` Appends the string.
`void` `write(java.lang.String attribute, ARXLattice.Anonymity anonymity)` Create an element.
`void` `write(java.lang.String attribute, ARXLattice.ARXNode[] array, java.util.Map<java.lang.String,java.lang.Integer> map)` Create an element.
`void` `write(java.lang.String attribute, boolean value)` Create an element.
`void` `write(java.lang.String attribute, char value)` Create an element.
`void` `write(java.lang.String attribute, double value)` Create an element.
`void` `write(java.lang.String attribute, int[] array)` Create an element.
`void` `write(java.lang.String attribute, long value)` Create an element.
`void` `write(java.lang.String attribute, java.lang.String value)` Create an element.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### XMLWriter

    public XMLWriter()
              throws java.io.IOException

Creates a new writer backed by a StringBuilder.

Throws:
  `java.io.IOException`

#### XMLWriter

    public XMLWriter(FileBuilder builder)
              throws java.io.IOException

Creates a new writer backed by the given FileBuilder.

Parameters:
  `builder` -
Throws:
  `java.io.IOException`

#### XMLWriter

    public XMLWriter(boolean compact)
              throws java.io.IOException

Creates a new writer backed by a StringBuilder.

Parameters:
  `compact` -
Throws:
  `java.io.IOException`

#### XMLWriter

    public XMLWriter(FileBuilder builder,
                     boolean compact)
              throws java.io.IOException

Creates a new writer backed by the given FileBuilder.

Parameters:
  `builder` -
  `compact` -
Throws:
  `java.io.IOException`

### Method Detail

#### indent

    public void indent(java.lang.String element)
                throws java.io.IOException

Intend the document.

Parameters:
  `element` -
Throws:
  `java.io.IOException`

#### indent

    public void indent(java.lang.String element,
                       java.lang.String attribute,
                       int value)
                throws java.io.IOException

Intend the document.

Parameters:
  `element` -
  `attribute` -
  `value` -
Throws:
  `java.io.IOException`

#### toString

    public java.lang.String toString()

Returns a string representation.

Overrides:
  `toString` in class `java.lang.Object`
Returns:

#### unindent

    public void unindent()
                  throws java.io.IOException

Unintend.

Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String string)
               throws java.io.IOException

Appends the string.

Parameters:
  `string` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      ARXLattice.Anonymity anonymity)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `anonymity` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      ARXLattice.ARXNode[] array,
                      java.util.Map<java.lang.String,java.lang.Integer> map)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `array` -
  `map` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      boolean value)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `value` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      char value)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `value` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      double value)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `value` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      int[] array)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `array` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      long value)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `value` -
Throws:
  `java.io.IOException`

#### write

    public void write(java.lang.String attribute,
                      java.lang.String value)
               throws java.io.IOException

Create an element.

Parameters:
  `attribute` -
  `value` -
Throws:
  `java.io.IOException`