Enum Class JsonToken

java.lang.Object
java.lang.Enum<JsonToken>
com.aspectran.utils.json.JsonToken
All Implemented Interfaces:
Serializable, Comparable<JsonToken>, Constable

public enum JsonToken extends Enum<JsonToken>

This class is a clone of com.google.gson.stream.JsonToken

A structure, name or value type in a JSON-encoded string.
Author:
Jesse Wilson
  • Enum Constant Details

    • BEGIN_ARRAY

      public static final JsonToken BEGIN_ARRAY
      The opening of a JSON array.
    • END_ARRAY

      public static final JsonToken END_ARRAY
      The closing of a JSON array.
    • BEGIN_OBJECT

      public static final JsonToken BEGIN_OBJECT
      The opening of a JSON object.
    • END_OBJECT

      public static final JsonToken END_OBJECT
      The closing of a JSON object.
    • NAME

      public static final JsonToken NAME
      A JSON property name. Within objects, tokens alternate between names and their values.
    • STRING

      public static final JsonToken STRING
      A JSON string.
    • NUMBER

      public static final JsonToken NUMBER
      A JSON number represented in this API by a Java double, long, or int.
    • BOOLEAN

      public static final JsonToken BOOLEAN
      A JSON true or false.
    • NULL

      public static final JsonToken NULL
      A JSON null.
    • END_DOCUMENT

      public static final JsonToken END_DOCUMENT
      The end of the JSON stream. This sentinel value is returned by JsonReader.peek() to signal that the JSON-encoded value has no more tokens.
  • Method Details

    • values

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

      public static JsonToken valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null