Enum JsonWriteState

java.lang.Object
java.lang.Enum<JsonWriteState>
com.azure.json.JsonWriteState
All Implemented Interfaces:
Serializable, Comparable<JsonWriteState>, java.lang.constant.Constable

public enum JsonWriteState extends Enum<JsonWriteState>
Writing context of the JSON stream.

Used by JsonWriter to maintain state and determine validity of a write operation.

  • Enum Constant Details

    • ROOT

      public static final JsonWriteState ROOT
      Root of the JSON stream.

      Indicates that writing hasn't begun.

    • OBJECT

      public static final JsonWriteState OBJECT
      In a JSON object.

      Indicates that either a JSON field, sub-object, or end of object should be written.

    • ARRAY

      public static final JsonWriteState ARRAY
      In a JSON array.

      Indicates that either a JSON value (binary data, boolean, number, string, object, or array) or end of array should be written.

    • FIELD

      public static final JsonWriteState FIELD
      In a JSON field.

      Indicates that a JSON value (binary data, boolean, number, string, object, or array) should be written.

    • COMPLETED

      public static final JsonWriteState COMPLETED
      JSON stream has completed.

      Indicates that a JSON value (binary data, boolean, number, string, object, or array) was written to root of the JSON stream. Writing after this point will result in invalid JSON, therefore all write operations will result in an exception being thrown.

  • Method Details

    • values

      public static JsonWriteState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static JsonWriteState valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null