elemental.json.impl.

Class JreJsonObject

    • Constructor Detail

      • JreJsonObject

        public JreJsonObject(JsonFactory factory)
    • Method Detail

      • asBoolean

        public boolean asBoolean()

        Description copied from interface: JsonValue

        Coerces underlying value to boolean according to the rules of Javascript coercion.

        Specified by:

        asBoolean in interface JsonValue

      • asNumber

        public double asNumber()

        Description copied from interface: JsonValue

        Coerces the underlying value to a number according to the rules of Javascript coercion.

        Specified by:

        asNumber in interface JsonValue

      • asString

        public String asString()

        Description copied from interface: JsonValue

        Coerces the underlying value to a String according to the rules of JavaScript coercion.

        Specified by:

        asString in interface JsonValue

      • getArray

        public JsonArray getArray(String key)

        Description copied from interface: JsonObject

        Return the element (uncoerced) as a JsonArray. If the type is not an array, this can result in runtime errors.

        Specified by:

        getArray in interface JsonObject

      • getBoolean

        public boolean getBoolean(String key)

        Description copied from interface: JsonObject

        Return the element (uncoerced) as a boolean. If the type is not a boolean, this can result in runtime errors.

        Specified by:

        getBoolean in interface JsonObject

      • getNumber

        public double getNumber(String key)

        Description copied from interface: JsonObject

        Return the element (uncoerced) as a number. If the type is not a number, this can result in runtime errors.

        Specified by:

        getNumber in interface JsonObject

      • getObject

        public JsonObject getObject(String key)

        Description copied from interface: JsonObject

        Return the element (uncoerced) as a JsonObject If the type is not an object,, this can result in runtime errors.

        Specified by:

        getObject in interface JsonObject

      • getString

        public String getString(String key)

        Description copied from interface: JsonObject

        Return the element (uncoerced) as a String. If the type is not a String, this can result in runtime errors.

        Specified by:

        getString in interface JsonObject

      • getType

        public JsonType getType()

        Description copied from interface: JsonValue

        Returns an enumeration representing the fundamental JSON type.

        Specified by:

        getType in interface JsonValue

      • hasKey

        public boolean hasKey(String key)

        Description copied from interface: JsonObject

        Test whether a given key has present.

        Specified by:

        hasKey in interface JsonObject

      • jsEquals

        public boolean jsEquals(JsonValue value)

        Description copied from interface: JsonValue

        Equivalent of Javascript '==' operator comparison between two values.

        Specified by:

        jsEquals in interface JsonValue

      • put

        public void put(String key,
                        String value)

        Description copied from interface: JsonObject

        Set a given key to the given String value.

        Specified by:

        put in interface JsonObject

      • put

        public void put(String key,
                        double value)

        Description copied from interface: JsonObject

        Set a given key to the given double value.

        Specified by:

        put in interface JsonObject

      • put

        public void put(String key,
                        boolean bool)

        Description copied from interface: JsonObject

        Set a given key to the given boolean value.

        Specified by:

        put in interface JsonObject

      • remove

        public void remove(String key)

        Description copied from interface: JsonObject

        Remove a given key and associated value from the object.

        Specified by:

        remove in interface JsonObject

      • toJson

        public String toJson()

        Description copied from interface: JsonValue

        Returns a serialized JSON string representing this value.

        Specified by:

        toJson in interface JsonValue

        Returns:

      • traverse

        public void traverse(elemental.json.impl.JsonVisitor visitor,
                             elemental.json.impl.JsonContext ctx)

        Specified by:

        traverse in class JreJsonValue