Enum Constant and Description |
---|
ARRAY
Class for JSON arrays.
|
LITERAL
Class (enum) for JSON literal values.
|
NUMBER
Class for JSON numbers.
|
OBJECT
Class for JSON objects.
|
STRING
Class for JSON strings.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isAssignableFrom(java.lang.Class<?> k)
Check if a Class can be used as a JSON value.
|
static boolean |
isInstance(java.lang.Object obj)
Check if an instantiated object is a valid JSON value.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
java.lang.Class<?> |
valueClass()
Accessor for the class member.
|
static JSONValue |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JSONValue[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JSONValue OBJECT
public static final JSONValue ARRAY
public static final JSONValue NUMBER
public static final JSONValue STRING
public static final JSONValue LITERAL
public static JSONValue[] values()
for (JSONValue c : JSONValue.values()) System.out.println(c);
public static JSONValue valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.Class<?> valueClass()
public java.lang.String toString()
toString
in class java.lang.Enum<JSONValue>
public static boolean isAssignableFrom(java.lang.Class<?> k)
k
- class to checktrue
if the class is a viable JSON value
class, false
if notpublic static boolean isInstance(java.lang.Object obj)
obj
- object to checktrue
if the object is a viable JSON value,
false
if not