Package org.glassfish.json
Class JsonReaderImpl
- java.lang.Object
-
- org.glassfish.json.JsonReaderImpl
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,JsonReader
class JsonReaderImpl extends java.lang.Object implements JsonReader
JsonReader impl using parser and builders.
-
-
Field Summary
Fields Modifier and Type Field Description private BufferPoolbufferPoolprivate JsonParserImplparserprivate booleanreadDone
-
Constructor Summary
Constructors Constructor Description JsonReaderImpl(java.io.InputStream in, java.nio.charset.Charset charset, BufferPool bufferPool)JsonReaderImpl(java.io.InputStream in, BufferPool bufferPool)JsonReaderImpl(java.io.Reader reader, BufferPool bufferPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this reader and frees any resources associated with the reader.JsonStructureread()Returns a JSON array or object that is represented in the input source.JsonArrayreadArray()Returns a JSON array that is represented in the input source.JsonObjectreadObject()Returns a JSON object that is represented in the input source.JsonValuereadValue()Returns a JSON value that is represented in the input source.
-
-
-
Field Detail
-
parser
private final JsonParserImpl parser
-
readDone
private boolean readDone
-
bufferPool
private final BufferPool bufferPool
-
-
Constructor Detail
-
JsonReaderImpl
JsonReaderImpl(java.io.Reader reader, BufferPool bufferPool)
-
JsonReaderImpl
JsonReaderImpl(java.io.InputStream in, BufferPool bufferPool)
-
JsonReaderImpl
JsonReaderImpl(java.io.InputStream in, java.nio.charset.Charset charset, BufferPool bufferPool)
-
-
Method Detail
-
read
public JsonStructure read()
Description copied from interface:JsonReaderReturns a JSON array or object that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readin interfaceJsonReader- Returns:
- a JSON object or array
-
readObject
public JsonObject readObject()
Description copied from interface:JsonReaderReturns a JSON object that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readObjectin interfaceJsonReader- Returns:
- a JSON object
-
readArray
public JsonArray readArray()
Description copied from interface:JsonReaderReturns a JSON array that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readArrayin interfaceJsonReader- Returns:
- a JSON array
-
readValue
public JsonValue readValue()
Description copied from interface:JsonReaderReturns a JSON value that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readValuein interfaceJsonReader- Returns:
- a JSON value
-
close
public void close()
Description copied from interface:JsonReaderCloses this reader and frees any resources associated with the reader. This method closes the underlying input source.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceJsonReader
-
-