de.caff.io.json

## Enum SimpleJsonWriter.State

- java.lang.Object
- - java.lang.Enum<SimpleJsonWriter.State>
  - - de.caff.io.json.SimpleJsonWriter.State

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SimpleJsonWriter.State>
  Enclosing class:
    SimpleJsonWriter

      static enum SimpleJsonWriter.State
      extends java.lang.Enum<SimpleJsonWriter.State>

  Internal state.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `FirstKey` Expects first key in an object.
    `FirstValue` Expects a value after a key or the first value in an array.
    `Key` Expects further key in an object.
    `None` State after all open environments are closed.
    `Relaxed` Special start state which allows JSON output which starts with a key or a value.
    `Value` Expects followup value in an array.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) boolean` | `allowsKey`
    `(package private) boolean` | `allowsValue`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) abstract SimpleJsonWriter.State` | `advance(java.util.Stack<Json.Env> stack)` Advance to the next state.
    `(package private) abstract boolean` | `needsSeparator(java.util.Stack<Json.Env> stack)` Is a separator required?
    `static SimpleJsonWriter.State` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static SimpleJsonWriter.State[]` | `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

    - #### Relaxed

          public static final SimpleJsonWriter.State Relaxed

      Special start state which allows JSON output which starts with a key or a value.

    - #### None

          public static final SimpleJsonWriter.State None

      State after all open environments are closed.

    - #### FirstValue

          public static final SimpleJsonWriter.State FirstValue

      Expects a value after a key or the first value in an array. No previous separator required. Standard start state for JSON files.

    - #### Value

          public static final SimpleJsonWriter.State Value

      Expects followup value in an array. Separator required.

    - #### FirstKey

          public static final SimpleJsonWriter.State FirstKey

      Expects first key in an object. No separator required.

    - #### Key

          public static final SimpleJsonWriter.State Key

      Expects further key in an object. Separator required.

  - ### Field Detail

    - #### allowsKey

          final boolean allowsKey

    - #### allowsValue

          final boolean allowsValue

  - ### Method Detail

    - #### values

          public static SimpleJsonWriter.State[] 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 (SimpleJsonWriter.State c : SimpleJsonWriter.State.values())
              System.out.println(c);

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

    - #### valueOf

          public static SimpleJsonWriter.State 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

    - #### advance

          @NotNull
          abstract SimpleJsonWriter.State advance(@NotNull
                                                           java.util.Stack<Json.Env> stack)

      Advance to the next state.
      Parameters:
        `stack` - current environment stack
      Returns:
        next state

    - #### needsSeparator

          abstract boolean needsSeparator(@NotNull
                                          java.util.Stack<Json.Env> stack)

      Is a separator required?
      Parameters:
        `stack` - current stack
      Returns:
        `true` if a separator is required, `false` if not