public abstract class Tokener
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Buffer |
buffer
BUFFER
|
protected NetworkParserLog |
logger |
static java.lang.String |
STOPCHARS |
| Constructor and Description |
|---|
Tokener() |
| Modifier and Type | Method and Description |
|---|---|
void |
back()
Back up one character.
|
char |
charAt(int pos)
Char at.
|
boolean |
checkValues(char... items)
Check values.
|
char |
getCurrentChar()
Gets the current char.
|
java.lang.String |
getNextString(int n)
Get the next n characters.
|
java.lang.String |
getNextTag() |
protected java.lang.String |
getStopChars() |
boolean |
isEnd()
Check if End of String
|
int |
length()
Gets the length.
|
char |
next()
Get the next character in the source string.
|
char |
nextClean()
Get the next char in the string, skipping whitespace.
|
char |
nextStartClean() |
java.lang.String |
nextString(char quote,
boolean allowCRLF) |
java.lang.String |
nextString(char quote,
boolean allowCRLF,
boolean allowQuote,
boolean mustQuote,
boolean nextStep)
Return the characters up to the next close quote character.
|
java.lang.Object |
nextValue(BaseItem creator,
boolean allowQuote)
Handle unquoted text.
|
java.lang.Object |
nextValue(BaseItem creator,
boolean allowQuote,
char c) |
abstract void |
parseToEntity(AbstractList<?> entityList) |
abstract void |
parseToEntity(SimpleKeyValueList<?,?> entity) |
int |
position()
Gets the index.
|
void |
setIndex(int index)
Sets the index.
|
boolean |
skip(int pos)
Skip.
|
java.lang.String |
skipPos(int n)
Get the next n characters.
|
boolean |
stepPos(java.lang.String search,
boolean order,
boolean notEscape)
Skip.
|
java.lang.String |
substring(int... positions) |
byte[] |
toArray() |
java.lang.String |
toString()
Make a printable string of this JSONTokener.
|
java.lang.String |
toText() |
Tokener |
withBuffer(Buffer buffer) |
Tokener |
withText(java.lang.String value)
Reset the Tokener
|
public static final java.lang.String STOPCHARS
protected Buffer buffer
protected NetworkParserLog logger
public Tokener withText(java.lang.String value)
value - The Text for parsingpublic void back()
public boolean isEnd()
public char next()
public java.lang.String getNextString(int n)
n - The number of characters to take.public java.lang.String skipPos(int n)
n - The number of characters to take.public char nextClean()
public char nextStartClean()
public java.lang.String nextString(char quote,
boolean allowCRLF)
public java.lang.String nextString(char quote,
boolean allowCRLF,
boolean allowQuote,
boolean mustQuote,
boolean nextStep)
quote - The quoting character, either "
(double quote) or '
(single quote).allowCRLF - is allow CRLF in StreamallowQuote - is allow Quote in StreammustQuote - must find Quote in StreamnextStep - must i step next after find Textpublic java.lang.Object nextValue(BaseItem creator, boolean allowQuote)
creator - The creatorobjectallowQuote - is allow Quote in Strempublic java.lang.Object nextValue(BaseItem creator, boolean allowQuote, char c)
protected java.lang.String getStopChars()
public boolean skip(int pos)
pos - the pospublic boolean stepPos(java.lang.String search,
boolean order,
boolean notEscape)
search - the The String of searchelementsorder - the if the order of search element importentnotEscape - Boolean if escaping the textpublic int position()
public int length()
public java.lang.String toString()
toString in class java.lang.Objectpublic char charAt(int pos)
pos - the Position of the bufferarraypublic char getCurrentChar()
public java.lang.String substring(int... positions)
positions - first is start Position, second is Endposition
Absolut fix Start and End start>0 StartPosition
end>Start EndPosition
Absolut from fix Position Start>0 Position end NULL To End
end -1 To this.index
Relativ from indexPosition Start Position from this.index +
(-Start) End = 0 current Positionpublic boolean checkValues(char... items)
items - the itemspublic java.lang.String getNextTag()
public void setIndex(int index)
index - the new indexpublic byte[] toArray()
public java.lang.String toText()
public abstract void parseToEntity(SimpleKeyValueList<?,?> entity)
public abstract void parseToEntity(AbstractList<?> entityList)