
Package ca.uhn.fhir.parser.json
Class JsonLikeValue
- java.lang.Object
-
- ca.uhn.fhir.parser.json.JsonLikeValue
-
- Direct Known Subclasses:
JsonLikeArray
,JsonLikeObject
public abstract class JsonLikeValue extends Object
This is the generalization of anything that is a "value" element in a JSON structure. This could be a JSON object, a JSON array, a scalar value (number, string, boolean), or a null.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonLikeValue.ScalarType
static class
JsonLikeValue.ValueType
-
Field Summary
Fields Modifier and Type Field Description static JsonLikeValue
FALSE
static JsonLikeValue
NULL
static JsonLikeValue
TRUE
-
Constructor Summary
Constructors Constructor Description JsonLikeValue()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static JsonLikeArray
asArray(JsonLikeValue element)
static boolean
asBoolean(JsonLikeValue element)
static JsonLikeObject
asObject(JsonLikeValue element)
static String
asString(JsonLikeValue element)
JsonLikeArray
getAsArray()
boolean
getAsBoolean()
Number
getAsNumber()
JsonLikeObject
getAsObject()
String
getAsString()
abstract JsonLikeValue.ScalarType
getDataType()
abstract JsonLikeValue.ValueType
getJsonType()
abstract Object
getValue()
boolean
isArray()
boolean
isNull()
boolean
isNumber()
boolean
isObject()
boolean
isScalar()
boolean
isString()
-
-
-
Field Detail
-
NULL
public static final JsonLikeValue NULL
-
TRUE
public static final JsonLikeValue TRUE
-
FALSE
public static final JsonLikeValue FALSE
-
-
Constructor Detail
-
JsonLikeValue
public JsonLikeValue()
-
-
Method Detail
-
getJsonType
public abstract JsonLikeValue.ValueType getJsonType()
-
getDataType
public abstract JsonLikeValue.ScalarType getDataType()
-
isArray
public boolean isArray()
-
isObject
public boolean isObject()
-
isScalar
public boolean isScalar()
-
isString
public boolean isString()
-
isNumber
public boolean isNumber()
-
isNull
public boolean isNull()
-
getAsArray
public JsonLikeArray getAsArray()
-
getAsObject
public JsonLikeObject getAsObject()
-
getAsString
public String getAsString()
-
getAsNumber
public Number getAsNumber()
-
getAsBoolean
public boolean getAsBoolean()
-
asArray
public static JsonLikeArray asArray(JsonLikeValue element)
-
asObject
public static JsonLikeObject asObject(JsonLikeValue element)
-
asString
public static String asString(JsonLikeValue element)
-
asBoolean
public static boolean asBoolean(JsonLikeValue element)
-
-