# Mode
Date: 2013-02-18

## org.simpleframework.xml.stream
Enum Mode

    java.lang.Object
      java.lang.Enum<Mode>
          org.simpleframework.xml.stream.Mode

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable<Mode>

    public enum Mode

extends java.lang.Enum<Mode>

The `Mode` enumeration is used to specify the output mode for XML text. This is used by the `OutputNode` to describe if element text will be escaped or wrapped in a CDATA block. The mode is a three state object, the third of the states indicates whether an explicit state has been set or not. If a specific state has not been set then the node will inherit its output mode from the last parent to have it set.

Author:
  Niall Gallagher
See Also:
  `OutputNode`

Enum Constant Summary
`DATA` Indicates that data written will be within a CDATA block.
`ESCAPE` Indicates that data written will be escaped if required.
`INHERIT` Indicates that the mode will be inherited from its parent.

Method Summary
`static Mode` `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
`static Mode[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Enum Constant Detail

### DATA

    public static final Mode DATA

  Indicates that data written will be within a CDATA block.

### ESCAPE

    public static final Mode ESCAPE

  Indicates that data written will be escaped if required.

### INHERIT

    public static final Mode INHERIT

  Indicates that the mode will be inherited from its parent.

Method Detail

### values

    public static Mode[] values()

  Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

      for (Mode c : Mode.values())
          System.out.println(c);

  Returns:
    an array containing the constants of this enum type, in the order they are declared

### valueOf

    public static Mode valueOf(java.lang.String name)

  Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

  Parameters:
    `name` - the name of the enum constant to be returned.
  Returns:
    the enum constant with the specified name
  Throws:
    `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
    `java.lang.NullPointerException` - if the argument is null