public final class DefaultJsonPushParser extends Object implements JsonPushParser
DefaultJsonPushParser is a stream based JSON parser. It reads
characters from a given Reader as far as necessary to calculate a
JsonState or to yield the next value.| Constructor and Description |
|---|
DefaultJsonPushParser(char[] characters)
Creates a new
DefaultJsonPushParser. |
DefaultJsonPushParser(JsonSource source)
Creates a new
DefaultJsonPushParser. |
DefaultJsonPushParser(JsonSource source,
JsonParserMode... modes)
Creates a new
DefaultJsonPushParser. |
DefaultJsonPushParser(Reader reader)
Creates a new
DefaultJsonPushParser. |
DefaultJsonPushParser(String string)
Creates a new
DefaultJsonPushParser. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getColumn()
Returns the
column that corresponds to the
current position of the underlying JsonSource in the character
sequence, as if the character source was a regular file. |
int |
getLine()
Returns the
line that corresponds to the
current position of the underlying JsonSource in the character
sequence, as if the character source was a regular file. |
<Result> Result |
handle(JsonHandler<Result> handler)
Handle the character sequence from the
JsonSource and report to
the JsonHandler. |
String |
toString() |
public DefaultJsonPushParser(String string) throws IllegalArgumentException
DefaultJsonPushParser.string - The String to read from.IllegalArgumentException - If the given String is null.public DefaultJsonPushParser(char[] characters)
throws IllegalArgumentException
DefaultJsonPushParser.characters - The char[] to read from.IllegalArgumentException - If the given char[] is null.public DefaultJsonPushParser(Reader reader) throws IllegalArgumentException
DefaultJsonPushParser.reader - The Reader to read from.IllegalArgumentException - If the given Reader is null.public DefaultJsonPushParser(JsonSource source) throws IllegalArgumentException
DefaultJsonPushParser.source - The JsonSource to read from.IllegalArgumentException - If the given JsonSource is null.public DefaultJsonPushParser(JsonSource source, JsonParserMode... modes) throws IllegalArgumentException
DefaultJsonPushParser.source - The JsonSource to read from.modes - Selection of JsonParserModes to be used
during parsing.IllegalArgumentException - If the given JsonSource is null.public <Result> Result handle(JsonHandler<Result> handler) throws IllegalArgumentException, JsonException, JsonSyntaxException, IOException
JsonPushParserJsonSource and report to
the JsonHandler.
Calling this method closes the underlying JsonSource, but it can
be closed manually.
handle in interface JsonPushParserResult - The result type of the JsonHandler.handler - The JsonHandler to report to.JsonHandler.IllegalArgumentException - If the given JsonHandler is null.JsonSyntaxException - If the JSON text contains a syntax error.JsonException - If the given JsonHandler failed while handling an
event.IOException - If reading from the underlying JsonSource failed.public int getLine()
JsonPushParserline that corresponds to the
current position of the underlying JsonSource in the character
sequence, as if the character source was a regular file.getLine in interface JsonPushParserpublic int getColumn()
JsonPushParsercolumn that corresponds to the
current position of the underlying JsonSource in the character
sequence, as if the character source was a regular file.getColumn in interface JsonPushParserpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2016 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.