Package kong.unirest.core.json
Class JSONElement
java.lang.Object
kong.unirest.core.json.JSONElement
- Direct Known Subclasses:
JSONArray
,JSONObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JsonEngine.Element
private static final JsonEngine
protected static final ToObjectMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionoptQuery
(JSONPointer query) query the object graph using JSONPointer https://tools.ietf.org/html/rfc6901query
(JSONPointer query) query the object graph using JSONPointer https://tools.ietf.org/html/rfc6901(package private) static String
toJson
(JsonEngine.Element collection) (package private) static JsonEngine.Object
toJsonObject
(Map map) toMap
(JsonEngine.Element obj) protected static String
(package private) static JsonEngine.Element
Write the JSON to a WriterWrite the JSON to a Writer with a pretty format due to limitations in GSON the index and indent are currently ignored(package private) static void
write
(JsonEngine.Element obj, Writer sw)
-
Field Details
-
MAPPER
-
ENGINE
-
element
-
-
Constructor Details
-
JSONElement
-
-
Method Details
-
write
Write the JSON to a Writer- Parameters:
sw
- the writer- Returns:
- the same Writer
- Throws:
JSONException
- for IO problems
-
write
Write the JSON to a Writer with a pretty format due to limitations in GSON the index and indent are currently ignored- Parameters:
sw
- the writerindentFactor
- currently ignoredindent
- currently ignored- Returns:
- the same Writer
- Throws:
JSONException
- for IO problems
-
query
query the object graph using JSONPointer https://tools.ietf.org/html/rfc6901- Parameters:
query
- the pointer to get- Returns:
- the thing you asked for
-
query
query the object graph using JSONPointer https://tools.ietf.org/html/rfc6901- Parameters:
query
- the pointer to get- Returns:
- the thing you asked for
-
optQuery
-
optQuery
-
getElement
-
toJsonObject
-
toJson
-
toTree
-
write
-
toPrettyJson
-
toMap
-