Package javax.json

Interface JsonValue



    • Field Detail

      • EMPTY_JSON_OBJECT

        🡇    
        static final JsonObject EMPTY_JSON_OBJECT
        The empty JSON object.
        Since:
        1.1
        Code:
        Exact Field Declaration Expression:
        static final JsonObject EMPTY_JSON_OBJECT = new EmptyObject();
        
      • EMPTY_JSON_ARRAY

        🡅  🡇    
        static final JsonArray EMPTY_JSON_ARRAY
        The empty JSON array.
        Since:
        1.1
        Code:
        Exact Field Declaration Expression:
        static final JsonArray EMPTY_JSON_ARRAY = new EmptyArray();
        
      • NULL

        🡅  🡇    
        static final JsonValue NULL
        JSON null value.
        Code:
        Exact Field Declaration Expression:
        static final JsonValue NULL = new JsonValueImpl(ValueType.NULL);
        
      • TRUE

        🡅  🡇    
        static final JsonValue TRUE
        JSON true value.
        Code:
        Exact Field Declaration Expression:
        static final JsonValue TRUE = new JsonValueImpl(ValueType.TRUE);
        
      • FALSE

        🡅  🡇    
        static final JsonValue FALSE
        JSON false value.
        Code:
        Exact Field Declaration Expression:
        static final JsonValue FALSE = new JsonValueImpl(ValueType.FALSE);
        
    • Method Detail

      • asJsonObject

        🡅  🡇    
        default JsonObject asJsonObject()
        Return the JsonValue as a JsonObject
        Returns:
        the JsonValue as a JsonObject
        Throws:
        java.lang.ClassCastException - if the JsonValue is not a JsonObject
        Since:
        1.1
        Code:
        Exact Method Body:
         return JsonObject.class.cast(this);
        
      • asJsonArray

        🡅  🡇    
        default JsonArray asJsonArray()
        Return the JsonValue as a JsonArray
        Returns:
        the JsonValue as a JsonArray
        Throws:
        java.lang.ClassCastException - if the JsonValue is not a JsonArray
        Since:
        1.1
        Code:
        Exact Method Body:
         return JsonArray.class.cast(this);
        
      • toString

        🡅    
        java.lang.String toString()
        Returns JSON text for this JSON value.
        Overrides:
        toString in class java.lang.Object
        Returns:
        JSON text