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 classJsonLikeValue.ScalarTypestatic classJsonLikeValue.ValueType
-
Field Summary
Fields Modifier and Type Field Description static JsonLikeValueFALSEstatic JsonLikeValueNULLstatic JsonLikeValueTRUE
-
Constructor Summary
Constructors Constructor Description JsonLikeValue()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static JsonLikeArrayasArray(JsonLikeValue element)static booleanasBoolean(JsonLikeValue element)static JsonLikeObjectasObject(JsonLikeValue element)static StringasString(JsonLikeValue element)JsonLikeArraygetAsArray()booleangetAsBoolean()NumbergetAsNumber()JsonLikeObjectgetAsObject()StringgetAsString()abstract JsonLikeValue.ScalarTypegetDataType()abstract JsonLikeValue.ValueTypegetJsonType()abstract ObjectgetValue()booleanisArray()booleanisNull()booleanisNumber()booleanisObject()booleanisScalar()booleanisString()
-
-
-
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)
-
-