public final class JSONArrayValidator extends Object implements JSONParseListener
Constructor and Description |
---|
JSONArrayValidator() |
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()
Called when the parsing ends.
|
void |
endingBracket(int index,
char character)
The level has changed
|
void |
keyValueSeparation(int colonIndex,
char character)
throws an exception
|
void |
openingBracket(int index,
char character)
Indicates that the initial bracket has been reached
|
void |
started()
Called when the parsing starts.
|
public boolean abort()
JSONParseListener
abort
in interface JSONParseListener
public 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, ClassCastException
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 elementClassCastException
public 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 ParseException
keyValueSeparation
in interface JSONParseListener
colonIndex
- the index of the colorcharacter
- the character used as a colorParseException
- Always; JSONArrays should not have key-value pairs.public void started() throws IllegalStateException
JSONParseListener
started
in interface JSONParseListener
IllegalStateException
- if this is called before started or between started and endedpublic void ended() throws ParseException, IllegalStateException
JSONParseListener
ended
in interface JSONParseListener
ParseException
- if there was an error with the parsingIllegalStateException
- if this is called before started or between started and endedpublic void endingBracket(int index, char character) throws IllegalStateException, ParseException
JSONParseListener
endingBracket
in interface JSONParseListener
index
- the location of the changecharacter
- the character used in the changeIllegalStateException
- if this is called before started or between started and endedParseException
- if there bracket was the wrong onepublic void openingBracket(int index, char character) throws IllegalStateException, ParseException
JSONParseListener
openingBracket
in interface JSONParseListener
index
- the location of the bracketcharacter
- the bracket characterIllegalStateException
- if this is called before started or between started and endedParseException
- if there bracket was the wrong one