Package org.apache.johnzon.core
Class JsonInMemoryParser
- java.lang.Object
-
- org.apache.johnzon.core.JohnzonJsonParserImpl
-
- org.apache.johnzon.core.JsonInMemoryParser
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,javax.json.stream.JsonParser
,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 javax.json.stream.JsonParser.Event
currentEvent
private javax.json.JsonValue
currentValue
private int
objectDepth
private SimpleStack<java.util.Iterator<javax.json.stream.JsonParser.Event>>
stack
-
Constructor Summary
Constructors Constructor Description JsonInMemoryParser(javax.json.JsonArray array, BufferStrategy.BufferProvider<char[]> bufferProvider)
JsonInMemoryParser(javax.json.JsonObject object, BufferStrategy.BufferProvider<char[]> bufferProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
javax.json.stream.JsonParser.Event
current()
java.math.BigDecimal
getBigDecimal()
protected BufferStrategy.BufferProvider<char[]>
getCharArrayProvider()
private static javax.json.stream.JsonParser.Event
getEvent(javax.json.JsonValue.ValueType value)
int
getInt()
javax.json.stream.JsonLocation
getLocation()
long
getLong()
java.lang.String
getString()
boolean
hasNext()
protected javax.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<java.util.Iterator<javax.json.stream.JsonParser.Event>> stack
-
bufferProvider
private final BufferStrategy.BufferProvider<char[]> bufferProvider
-
currentEvent
private javax.json.stream.JsonParser.Event currentEvent
-
currentValue
private javax.json.JsonValue currentValue
-
arrayDepth
private int arrayDepth
-
objectDepth
private int objectDepth
-
-
Constructor Detail
-
JsonInMemoryParser
JsonInMemoryParser(javax.json.JsonObject object, BufferStrategy.BufferProvider<char[]> bufferProvider)
-
JsonInMemoryParser
JsonInMemoryParser(javax.json.JsonArray array, BufferStrategy.BufferProvider<char[]> bufferProvider)
-
-
Method Detail
-
current
public javax.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 javax.json.stream.JsonParser.Event getEvent(javax.json.JsonValue.ValueType value)
-
hasNext
public boolean hasNext()
-
internalNext
protected javax.json.stream.JsonParser.Event internalNext()
- Specified by:
internalNext
in classJohnzonJsonParserImpl
-
getString
public java.lang.String getString()
-
isIntegralNumber
public boolean isIntegralNumber()
-
isNotTooLong
public boolean isNotTooLong()
-
getInt
public int getInt()
-
getLong
public long getLong()
-
isFitLong
public boolean isFitLong()
-
getBigDecimal
public java.math.BigDecimal getBigDecimal()
-
getLocation
public javax.json.stream.JsonLocation getLocation()
-
close
public void close()
-
-