Package com.jcabi.http.response
Class JacksonResponse.JsonReader
java.lang.Object
com.jcabi.http.response.JacksonResponse.JsonReader
- Enclosing class:
- JacksonResponse
A tree representation views of JSON documents.
- Since:
- 1.17.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNoderead()Returns an immutable JSON node.com.fasterxml.jackson.databind.node.ArrayNodeReturns a mutable JSON array node, if the parsed JSON is a valid array.com.fasterxml.jackson.databind.node.ObjectNodeReturns a mutable JSON object node, if the parsed JSON is a valid object.
-
Constructor Details
-
JsonReader
public JsonReader(byte[] bytes) Public constructor.- Parameters:
bytes- The HTTP response body as an array of bytes.
-
-
Method Details
-
readArray
Returns a mutable JSON array node, if the parsed JSON is a valid array.- Returns:
- JSON array node.
- Throws:
IOException- If the body is not a valid JSON or JSON array.
-
readObject
Returns a mutable JSON object node, if the parsed JSON is a valid object.- Returns:
- JSON object node.
- Throws:
IOException- If the body is not a valid JSON or JSON object.
-
read
Returns an immutable JSON node.- Returns:
- JSON node.
- Throws:
IOException- If the body is not a valid JSON.
-