Enum JSONValidator.Type

java.lang.Object
java.lang.Enum<JSONValidator.Type>
com.alibaba.fastjson2.JSONValidator.Type
All Implemented Interfaces:
Serializable, Comparable<JSONValidator.Type>, java.lang.constant.Constable
Enclosing class:
JSONValidator

public static enum JSONValidator.Type extends Enum<JSONValidator.Type>
An enumeration representing the type of JSON structure.

JSON can be one of three types:

  • Object - A JSON object, enclosed in curly braces {}
  • Array - A JSON array, enclosed in square brackets []
  • Value - A JSON value, which can be a string, number, boolean, or null
  • Enum Constant Details

    • Object

      public static final JSONValidator.Type Object
      Represents a JSON object structure (enclosed in curly braces {})
    • Array

      public static final JSONValidator.Type Array
      Represents a JSON array structure (enclosed in square brackets [])
    • Value

      public static final JSONValidator.Type Value
      Represents a JSON value (string, number, boolean, or null)
  • Method Details

    • values

      public static JSONValidator.Type[] 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 JSONValidator.Type 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