public class JSONStreamReaderImpl extends Object implements JSONReader
JSONReader.EventType| Constructor and Description |
|---|
JSONStreamReaderImpl(Reader reader) |
| Modifier and Type | Method and Description |
|---|---|
JSONDocument |
build()
Build an in-memory representation of the input JSON.
|
void |
close()
Close the underlying Reader when done reading.
|
int |
column()
The current column number in the JSON file.
|
int |
depth()
The reader's current depth in the JSON file.
|
boolean |
hasNext() |
Iterator<JSONReader.EventType> |
iterator() |
String |
key()
The name of the current JSON object.
|
int |
line()
The current line number in the JSON file.
|
JSONReader.EventType |
next() |
JSONReader.EventType |
next(String objectName,
int depth)
Skips until the specified object is found at the specified depth.
|
long |
offset()
The current byte offset in the underlying Reader.
|
String[] |
path()
Returns the path from the root to the current position of the JSON file.
|
void |
remove() |
String |
toString() |
String |
value()
The value of the current JSON object or array element.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorforEachRemainingpublic JSONStreamReaderImpl(Reader reader) throws JSONException
JSONExceptionpublic Iterator<JSONReader.EventType> iterator()
iterator in interface Iterable<JSONReader.EventType>public JSONReader.EventType next(String objectName, int depth) throws JSONException
next in interface JSONReaderobjectName - the name of the object to find, may be nulldepth - stop at the first element at this depth, ignored if negativeJSONException - in case of parse errorspublic JSONReader.EventType next() throws JSONException
next in interface Iterator<JSONReader.EventType>JSONExceptionpublic boolean hasNext()
hasNext in interface Iterator<JSONReader.EventType>public void remove()
remove in interface Iterator<JSONReader.EventType>public String value()
JSONReadervalue in interface JSONReaderpublic int line()
JSONReaderline in interface JSONReaderpublic int column()
JSONReadercolumn in interface JSONReaderpublic long offset()
JSONReaderoffset in interface JSONReaderpublic int depth()
JSONReaderdepth in interface JSONReaderpublic String[] path()
JSONReaderpath in interface JSONReaderpublic String key()
JSONReaderkey in interface JSONReaderpublic JSONDocument build()
JSONReaderbuild in interface JSONReaderpublic void close()
JSONReaderclose in interface JSONReaderCopyright © 2025. All rights reserved.