Uses of Interface
jdk.incubator.json.JsonValue

Packages that use JsonValue
Package
Description
This API supports processing of JSON text in a simple manner.
  • Uses of JsonValue in jdk.incubator.json

    Subinterfaces of JsonValue in jdk.incubator.json
    Modifier and Type
    Interface
    Description
    interface 
    The interface that represents JSON array.
    interface 
    The interface that represents the JSON boolean literals, "true" and "false".
    interface 
    The interface that represents JSON null.
    interface 
    The interface that represents JSON number, an arbitrary-precision number represented in base 10 using decimal digits.
    interface 
    The interface that represents JSON object.
    interface 
    The interface that represents JSON string.
    Methods in jdk.incubator.json that return JsonValue
    Modifier and Type
    Method
    Description
    default JsonValue
    JsonArray.get(int index)
    Returns the JsonValue associated with the given index if this JsonValue is an instance of JsonArray; otherwise, throws a JsonValueException.
    default JsonValue
    JsonObject.get(String name)
    Returns the JsonValue associated with the given member name if this JsonValue is an instance of JsonObject; otherwise, throws a JsonValueException.
    default JsonValue
    JsonValue.get(int index)
    Returns the JsonValue associated with the given index if this JsonValue is an instance of JsonArray; otherwise, throws a JsonValueException.
    default JsonValue
    JsonValue.get(String name)
    Returns the JsonValue associated with the given member name if this JsonValue is an instance of JsonObject; otherwise, throws a JsonValueException.
    static JsonValue
    Json.parse(char[] in)
    Parses and creates a JsonValue from the given JSON text.
    static JsonValue
    Json.parse(String in)
    Parses and creates a JsonValue from the given JSON text.
    Methods in jdk.incubator.json that return types with arguments of type JsonValue
    Modifier and Type
    Method
    Description
    JsonArray.asList()
    Returns an unmodifiable list of the JsonValues if this JsonValue is an instance of JsonArray; otherwise, throws a JsonValueException.
    default List<JsonValue>
    JsonValue.asList()
    Returns an unmodifiable list of the JsonValues if this JsonValue is an instance of JsonArray; otherwise, throws a JsonValueException.
    JsonObject.asMap()
    Returns an unmodifiable map of String to JsonValue if this JsonValue is an instance of JsonObject; otherwise, throws a JsonValueException.
    default Map<String, JsonValue>
    JsonValue.asMap()
    Returns an unmodifiable map of String to JsonValue if this JsonValue is an instance of JsonObject; otherwise, throws a JsonValueException.
    JsonObject.tryGet(String name)
    Returns an Optional containing the value of a given member of this JsonObject, or an empty Optional if the member is absent; throws JsonValueException if this JsonValue is not a JsonObject.
    JsonValue.tryGet(String name)
    Returns an Optional containing the value of a given member of this JsonObject, or an empty Optional if the member is absent; throws JsonValueException if this JsonValue is not a JsonObject.
    JsonValue.tryValue()
    Returns an Optional containing this JsonValue if it is not an instance of JsonNull, otherwise an empty Optional.
    Methods in jdk.incubator.json with parameters of type JsonValue
    Modifier and Type
    Method
    Description
    static String
    Json.toDisplayString(JsonValue value, String indent)
    Returns the String representation of the given JsonValue that conforms to the JSON syntax.
    Method parameters in jdk.incubator.json with type arguments of type JsonValue
    Modifier and Type
    Method
    Description
    static JsonArray
    JsonArray.of(List<? extends JsonValue> src)
    Returns the JsonArray whose contents are copied from the given list of JsonValues.
    static JsonObject
    JsonObject.of(Map<String, ? extends JsonValue> map)
    Returns the JsonObject created from the given map of String to JsonValues.