public final class GetElementBounds extends Object implements JSONParseListener
Constructor and Description |
---|
GetElementBounds(int index)
Creates a BoundsJSONParseListener that will find the bounds of the spcified
index in the list or object parsed.
|
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
|
int |
getElementEndIndex()
returns the element's end index
|
int |
getElementStartIndex()
returns the element's start index
|
int |
getKeyValueSplitIndex()
returns the element's separation index
|
void |
keyValueSeparation(int colonIndex,
char character)
A key has ended and a value has started
|
void |
openingBracket(int index,
char character)
Indicates that the initial bracket has been reached
|
void |
started()
Called when the parsing starts.
|
public GetElementBounds(int index)
index
- the index this should look forpublic boolean abort() throws IllegalStateException
JSONParseListener
abort
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, ClassCastException
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 keyClassCastException
- if the key is not of the JSONString type, or a similar error occurs.public 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 final int getElementStartIndex()
public final int getElementEndIndex()
public final int getKeyValueSplitIndex()
public void charRead(int index, char character)
JSONParseListener
charRead
in interface JSONParseListener
index
- the index of the charactercharacter
- the read characterpublic void ended()
JSONParseListener
ended
in interface JSONParseListener
public void endingBracket(int index, char character)
JSONParseListener
endingBracket
in interface JSONParseListener
index
- the location of the changecharacter
- the character used in the changepublic void openingBracket(int index, char character)
JSONParseListener
openingBracket
in interface JSONParseListener
index
- the location of the bracketcharacter
- the bracket character