Package org.apache.johnzon.core
Class JsonInMemoryParser
- java.lang.Object
-
- org.apache.johnzon.core.JohnzonJsonParserImpl
-
- org.apache.johnzon.core.JsonInMemoryParser
-
- All Implemented Interfaces:
jakarta.json.stream.JsonParser
,Closeable
,AutoCloseable
,JohnzonJsonParser
class JsonInMemoryParser extends JohnzonJsonParserImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JsonInMemoryParser.ArrayIterator
private class
JsonInMemoryParser.ObjectIterator
-
Nested classes/interfaces inherited from interface org.apache.johnzon.core.JohnzonJsonParser
JohnzonJsonParser.JohnzonJsonParserWrapper
-
-
Field Summary
Fields Modifier and Type Field Description private int
arrayDepth
private BufferStrategy.BufferProvider<char[]>
bufferProvider
private jakarta.json.stream.JsonParser.Event
currentEvent
private jakarta.json.JsonValue
currentValue
private int
objectDepth
private SimpleStack<Iterator<jakarta.json.stream.JsonParser.Event>>
stack
-
Constructor Summary
Constructors Constructor Description JsonInMemoryParser(jakarta.json.JsonArray array, BufferStrategy.BufferProvider<char[]> bufferProvider, JsonProviderImpl provider)
JsonInMemoryParser(jakarta.json.JsonObject object, BufferStrategy.BufferProvider<char[]> bufferProvider, JsonProviderImpl provider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
jakarta.json.stream.JsonParser.Event
current()
jakarta.json.stream.JsonParser.Event
currentEvent()
BigDecimal
getBigDecimal()
protected BufferStrategy.BufferProvider<char[]>
getCharArrayProvider()
private static jakarta.json.stream.JsonParser.Event
getEvent(jakarta.json.JsonValue.ValueType value)
int
getInt()
jakarta.json.stream.JsonLocation
getLocation()
long
getLong()
String
getString()
boolean
hasNext()
protected jakarta.json.stream.JsonParser.Event
internalNext()
boolean
isFitLong()
protected boolean
isInArray()
protected boolean
isInObject()
boolean
isIntegralNumber()
boolean
isNotTooLong()
-
Methods inherited from class org.apache.johnzon.core.JohnzonJsonParserImpl
getArray, getArrayStream, getObject, getObjectStream, getValue, getValueStream, next, skipArray, skipObject
-
-
-
-
Field Detail
-
stack
private final SimpleStack<Iterator<jakarta.json.stream.JsonParser.Event>> stack
-
bufferProvider
private final BufferStrategy.BufferProvider<char[]> bufferProvider
-
currentEvent
private jakarta.json.stream.JsonParser.Event currentEvent
-
currentValue
private jakarta.json.JsonValue currentValue
-
arrayDepth
private int arrayDepth
-
objectDepth
private int objectDepth
-
-
Constructor Detail
-
JsonInMemoryParser
JsonInMemoryParser(jakarta.json.JsonObject object, BufferStrategy.BufferProvider<char[]> bufferProvider, JsonProviderImpl provider)
-
JsonInMemoryParser
JsonInMemoryParser(jakarta.json.JsonArray array, BufferStrategy.BufferProvider<char[]> bufferProvider, JsonProviderImpl provider)
-
-
Method Detail
-
currentEvent
public jakarta.json.stream.JsonParser.Event currentEvent()
-
current
public jakarta.json.stream.JsonParser.Event current()
- Returns:
- the _current_ Event. That's the one returned by the previous call to
JsonParser.next()
but without propagating the Event pointer to the next entry.
-
isInArray
protected boolean isInArray()
- Specified by:
isInArray
in classJohnzonJsonParserImpl
- Returns:
true
if we are currently inside an array
-
isInObject
protected boolean isInObject()
- Specified by:
isInObject
in classJohnzonJsonParserImpl
- Returns:
true
if we are currently inside an object
-
getCharArrayProvider
protected BufferStrategy.BufferProvider<char[]> getCharArrayProvider()
- Specified by:
getCharArrayProvider
in classJohnzonJsonParserImpl
-
getEvent
private static jakarta.json.stream.JsonParser.Event getEvent(jakarta.json.JsonValue.ValueType value)
-
hasNext
public boolean hasNext()
-
internalNext
protected jakarta.json.stream.JsonParser.Event internalNext()
- Specified by:
internalNext
in classJohnzonJsonParserImpl
-
getString
public String getString()
-
isIntegralNumber
public boolean isIntegralNumber()
-
isNotTooLong
public boolean isNotTooLong()
-
getInt
public int getInt()
-
getLong
public long getLong()
-
isFitLong
public boolean isFitLong()
-
getBigDecimal
public BigDecimal getBigDecimal()
-
getLocation
public jakarta.json.stream.JsonLocation getLocation()
-
close
public void close()
-
-