Package org.apache.johnzon.core
Class JsonReaderImpl
- java.lang.Object
-
- org.apache.johnzon.core.JsonReaderImpl
-
- All Implemented Interfaces:
jakarta.json.JsonReader
,Closeable
,AutoCloseable
public class JsonReaderImpl extends Object implements jakarta.json.JsonReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonReaderImpl.NothingToRead
-
Field Summary
Fields Modifier and Type Field Description private BufferStrategy.BufferProvider<char[]>
bufferProvider
private boolean
closed
private JohnzonJsonParser
parser
private JsonProviderImpl
provider
private RejectDuplicateKeysMode
rejectDuplicateKeysMode
private boolean
subStreamReader
-
Constructor Summary
Constructors Constructor Description JsonReaderImpl(jakarta.json.stream.JsonParser parser, boolean subStreamReader, BufferStrategy.BufferProvider<char[]> bufferProvider, RejectDuplicateKeysMode rejectDuplicateKeys, JsonProviderImpl provider)
JsonReaderImpl(jakarta.json.stream.JsonParser parser, BufferStrategy.BufferProvider<char[]> bufferProvider, RejectDuplicateKeysMode rejectDuplicateKeysMode, JsonProviderImpl provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkClosed()
private void
checkType(Class<?> expected, jakarta.json.JsonStructure read)
void
close()
private void
parseArray(jakarta.json.JsonArrayBuilder builder)
private void
parseObject(jakarta.json.JsonObjectBuilder builder)
jakarta.json.JsonStructure
read()
jakarta.json.JsonArray
readArray()
jakarta.json.JsonObject
readObject()
jakarta.json.JsonValue
readValue()
-
-
-
Field Detail
-
parser
private final JohnzonJsonParser parser
-
bufferProvider
private final BufferStrategy.BufferProvider<char[]> bufferProvider
-
provider
private JsonProviderImpl provider
-
rejectDuplicateKeysMode
private final RejectDuplicateKeysMode rejectDuplicateKeysMode
-
closed
private boolean closed
-
subStreamReader
private boolean subStreamReader
-
-
Constructor Detail
-
JsonReaderImpl
public JsonReaderImpl(jakarta.json.stream.JsonParser parser, BufferStrategy.BufferProvider<char[]> bufferProvider, RejectDuplicateKeysMode rejectDuplicateKeysMode, JsonProviderImpl provider)
-
JsonReaderImpl
public JsonReaderImpl(jakarta.json.stream.JsonParser parser, boolean subStreamReader, BufferStrategy.BufferProvider<char[]> bufferProvider, RejectDuplicateKeysMode rejectDuplicateKeys, JsonProviderImpl provider)
- Parameters:
parser
- json parser.subStreamReader
-true
if the Stream already got started and the first operation should not be next() butJohnzonJsonParser.current()
instead.bufferProvider
- buffer provider for toString of created instances.
-
-
Method Detail
-
read
public jakarta.json.JsonStructure read()
- Specified by:
read
in interfacejakarta.json.JsonReader
-
readValue
public jakarta.json.JsonValue readValue()
- Specified by:
readValue
in interfacejakarta.json.JsonReader
-
readObject
public jakarta.json.JsonObject readObject()
- Specified by:
readObject
in interfacejakarta.json.JsonReader
-
readArray
public jakarta.json.JsonArray readArray()
- Specified by:
readArray
in interfacejakarta.json.JsonReader
-
checkType
private void checkType(Class<?> expected, jakarta.json.JsonStructure read)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacejakarta.json.JsonReader
-
parseObject
private void parseObject(jakarta.json.JsonObjectBuilder builder)
-
parseArray
private void parseArray(jakarta.json.JsonArrayBuilder builder)
-
checkClosed
private void checkClosed()
-
-