Package org.glassfish.json
Class JsonReaderImpl
java.lang.Object
org.glassfish.json.JsonReaderImpl
- All Implemented Interfaces:
Closeable
,AutoCloseable
,JsonReader
JsonReader impl using parser and builders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BufferPool
private final JsonParserImpl
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionJsonReaderImpl
(InputStream in, Charset charset, BufferPool bufferPool) JsonReaderImpl
(InputStream in, BufferPool bufferPool) JsonReaderImpl
(Reader reader, BufferPool bufferPool) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this reader and frees any resources associated with the reader.read()
Returns a JSON array or object that is represented in the input source.Returns a JSON array that is represented in the input source.Returns a JSON object that is represented in the input source.Returns a JSON value that is represented in the input source.
-
Field Details
-
parser
-
readDone
private boolean readDone -
bufferPool
-
-
Constructor Details
-
JsonReaderImpl
JsonReaderImpl(Reader reader, BufferPool bufferPool) -
JsonReaderImpl
JsonReaderImpl(InputStream in, BufferPool bufferPool) -
JsonReaderImpl
JsonReaderImpl(InputStream in, Charset charset, BufferPool bufferPool)
-
-
Method Details
-
read
Description copied from interface:JsonReader
Returns 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:
read
in interfaceJsonReader
- Returns:
- a JSON object or array
-
readObject
Description copied from interface:JsonReader
Returns a JSON object that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readObject
in interfaceJsonReader
- Returns:
- a JSON object
-
readArray
Description copied from interface:JsonReader
Returns a JSON array that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readArray
in interfaceJsonReader
- Returns:
- a JSON array
-
readValue
Description copied from interface:JsonReader
Returns a JSON value that is represented in the input source. This method needs to be called only once for a reader instance.- Specified by:
readValue
in interfaceJsonReader
- Returns:
- a JSON value
-
close
public void close()Description copied from interface:JsonReader
Closes this reader and frees any resources associated with the reader. This method closes the underlying input source.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceJsonReader
-