|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.github.fge.jackson.JsonNodeReader
@ThreadSafe public final class JsonNodeReader
Class dedicated to reading JSON values from InputStream
s and Reader
s
This class wraps a Jackson ObjectMapper
so that it read one, and
only one, JSON text from a source. By default, when you read and map an
input source, Jackson will stop after it has read the first valid JSON text;
this means, for instance, that with this as an input:
[]]]
it will read the initial empty array ([]
) and stop there. This
class, instead, will peek to see whether anything is after the initial array,
and throw an exception if it finds anything.
Note: the input sources are closed by the read methods.
ObjectMapper.readValues(JsonParser, Class)
Constructor Summary | |
---|---|
JsonNodeReader()
No-arg constructor (see description) |
|
JsonNodeReader(ObjectMapper mapper)
|
Method Summary | |
---|---|
JsonNode |
fromInputStream(InputStream in)
Read a JSON value from an InputStream |
JsonNode |
fromReader(Reader r)
Read a JSON value from a Reader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonNodeReader(ObjectMapper mapper)
public JsonNodeReader()
Method Detail |
---|
public JsonNode fromInputStream(InputStream in) throws IOException
InputStream
in
- the input stream
IOException
- malformed input, or problem encountered when reading
from the streampublic JsonNode fromReader(Reader r) throws IOException
Reader
r
- the reader
IOException
- malformed input, or problem encountered when reading
from the reader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |