Class JsonObject
- java.lang.Object
-
- org.hl7.fhir.utilities.json.model.JsonElement
-
- org.hl7.fhir.utilities.json.model.JsonObject
-
public class JsonObject extends JsonElement
-
-
Constructor Summary
Constructors Constructor Description JsonObject()
-
Method Summary
-
Methods inherited from class org.hl7.fhir.utilities.json.model.JsonElement
asJsonArray, asJsonBoolean, asJsonNull, asJsonNumber, asJsonObject, asJsonPrimitive, asJsonString, asString, check, getComments, getEnd, getStart, hasComments, isJsonArray, isJsonBoolean, isJsonNull, isJsonNumber, isJsonObject, isJsonPrimitive, isJsonString, setEnd, setStart
-
-
-
-
Constructor Detail
-
JsonObject
public JsonObject()
-
-
Method Detail
-
type
public JsonElementType type()
- Specified by:
typein classJsonElement
-
add
public JsonObject add(String name, JsonElement value) throws JsonException
- Throws:
JsonException
-
addForParser
public JsonObject addForParser(String name, JsonElement value, boolean noComma, boolean nameUnquoted, boolean valueUnquoted) throws JsonException
- Throws:
JsonException
-
add
public JsonObject add(String name, String value) throws JsonException
- Throws:
JsonException
-
add
public JsonObject add(String name, boolean value) throws JsonException
- Throws:
JsonException
-
add
public JsonObject add(String name, int value) throws JsonException
- Throws:
JsonException
-
set
public JsonObject set(String name, JsonElement value) throws JsonException
- Throws:
JsonException
-
set
public JsonObject set(String name, Instant value) throws JsonException
- Throws:
JsonException
-
set
public JsonObject set(String name, String value) throws JsonException
- Throws:
JsonException
-
set
public JsonObject set(String name, boolean value) throws JsonException
- Throws:
JsonException
-
set
public JsonObject set(String name, int value) throws JsonException
- Throws:
JsonException
-
get
public JsonElement get(String name)
-
getProperties
public List<JsonProperty> getProperties()
-
hasPrimitive
public boolean hasPrimitive(String name)
-
hasBoolean
public boolean hasBoolean(String name)
-
getJsonObject
public JsonObject getJsonObject(String name)
-
getJsonString
public JsonString getJsonString(String name)
-
getJsonBoolean
public JsonBoolean getJsonBoolean(String name)
-
getJsonNumber
public JsonNumber getJsonNumber(String name)
-
getJsonNull
public JsonNull getJsonNull(String name)
-
getJsonArray
public JsonArray getJsonArray(String name)
-
asInstant
public Instant asInstant(String name) throws ParseException
- Throws:
ParseException
-
forceObject
public JsonObject forceObject(String name) throws JsonException
- Throws:
JsonException
-
forceArray
public JsonArray forceArray(String name) throws JsonException
- Throws:
JsonException
-
getJsonObjects
public List<JsonObject> getJsonObjects(String name)
-
getStrings
public List<String> getStrings(String name)
-
deepCopy
public JsonObject deepCopy()
- Overrides:
deepCopyin classJsonElement
-
copy
protected JsonElement copy(JsonElement other)
- Specified by:
copyin classJsonElement
-
make
protected JsonElement make()
- Specified by:
makein classJsonElement
-
findByStringProp
public JsonObject findByStringProp(String arrName, String prop, String value)
-
merge
public void merge(JsonObject source)
-
isExtraComma
public boolean isExtraComma()
-
setExtraComma
public void setExtraComma(boolean extraComma)
-
-