Package com.jcabi.http.response
Class JacksonResponse.JsonReader
- java.lang.Object
-
- com.jcabi.http.response.JacksonResponse.JsonReader
-
- Enclosing class:
- JacksonResponse
public static final class JacksonResponse.JsonReader extends Object
A tree representation views of JSON documents.- Since:
- 1.17.1
-
-
Constructor Summary
Constructors Constructor Description JsonReader(byte[] bytes)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNode
read()
Returns an immutable JSON node.com.fasterxml.jackson.databind.node.ArrayNode
readArray()
Returns a mutable JSON array node, if the parsed JSON is a valid array.com.fasterxml.jackson.databind.node.ObjectNode
readObject()
Returns a mutable JSON object node, if the parsed JSON is a valid object.
-
-
-
Method Detail
-
readArray
public com.fasterxml.jackson.databind.node.ArrayNode readArray() throws IOException
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
public com.fasterxml.jackson.databind.node.ObjectNode readObject() throws IOException
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
public com.fasterxml.jackson.databind.JsonNode read() throws IOException
Returns an immutable JSON node.- Returns:
- JSON node.
- Throws:
IOException
- If the body is not a valid JSON.
-
-