public final class NextJSONObjectParseListener extends Object implements JSONParseListener
Constructor and Description |
---|
NextJSONObjectParseListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
returns whether the parsing can end at this time
|
void |
charRead(int index,
char character)
A character has been read
|
void |
elemEnded(int commaIndex,
char character)
An element has ended
|
void |
elemStarted(int commaIndex,
char character)
An element has started
|
void |
ended()
does nothing
|
void |
endingBracket(int index,
char character)
does nothing
|
int |
getColonIndex() |
int |
getEndCommaIndex() |
JSONObjectEntry |
getEntry(String unparsed) |
Object |
getParsedKey() |
Object |
getParsedValue() |
int |
getStartCommaIndex() |
String |
getUnparsedKey() |
String |
getUnparsedValue() |
void |
keyValueSeparation(int colonIndex,
char character)
A key has ended and a value has started
|
void |
openingBracket(int index,
char character)
does nothing
|
void |
started()
Called when the parsing starts.
|
public boolean abort() throws IllegalStateException
JSONParseListener
abort
in interface JSONParseListener
IllegalStateException
- if this is called before started or between started and endedpublic void charRead(int index, char character) throws IllegalStateException
JSONParseListener
charRead
in interface JSONParseListener
index
- the index of the charactercharacter
- the read characterIllegalStateException
- if this is called before started or between started and endedpublic void elemEnded(int commaIndex, char character) throws IllegalStateException, ParseException
JSONParseListener
elemEnded
in interface JSONParseListener
commaIndex
- the index of the commacharacter
- the character that ended the elementIllegalStateException
- if this is called before started or between started and endedParseException
- if there was a problem with the elementpublic void started() throws IllegalStateException
JSONParseListener
started
in interface JSONParseListener
IllegalStateException
- if this is called before started or between started and endedpublic void elemStarted(int commaIndex, char character) throws IllegalStateException
JSONParseListener
elemStarted
in interface JSONParseListener
commaIndex
- the index of the commacharacter
- the character that started the elementIllegalStateException
- if this is called before started or between started and endedpublic void keyValueSeparation(int colonIndex, char character) throws IllegalStateException, ParseException
JSONParseListener
keyValueSeparation
in interface JSONParseListener
colonIndex
- the index of the commacharacter
- the character that split the elementIllegalStateException
- if this is called before started or between started and endedParseException
- if there was a problem with the keypublic String getUnparsedKey()
public Object getParsedKey()
public String getUnparsedValue()
public Object getParsedValue()
public int getStartCommaIndex()
public int getEndCommaIndex()
public int getColonIndex()
public JSONObjectEntry getEntry(String unparsed)
public void ended() throws IllegalStateException, ParseException
ended
in interface JSONParseListener
IllegalStateException
- if this is called before started or between started and endedParseException
- if there was an error with the parsingpublic void endingBracket(int index, char character)
endingBracket
in interface JSONParseListener
index
- no effectcharacter
- no effectpublic void openingBracket(int index, char character)
openingBracket
in interface JSONParseListener
index
- no effectcharacter
- no effect