|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.oak.commons.json.JsopTokenizer
public class JsopTokenizer
A tokenizer for Json and Jsop strings.
| Field Summary |
|---|
| Fields inherited from interface org.apache.jackrabbit.oak.commons.json.JsopReader |
|---|
COMMENT, END, ERROR, FALSE, IDENTIFIER, NULL, NUMBER, STRING, TRUE |
| Constructor Summary | |
|---|---|
JsopTokenizer(String json)
|
|
JsopTokenizer(String json,
int pos)
|
|
| Method Summary | |
|---|---|
static String |
decode(String s)
Decode a Json string. |
static String |
decodeQuoted(String s)
Decode a quoted Json string. |
String |
getEscapedToken()
Get the last encoded (raw) string, including escape sequences. |
int |
getLastPos()
|
int |
getPos()
|
String |
getToken()
Get the last token value if the the token type was STRING or NUMBER. |
int |
getTokenType()
Get the token type of the last token. |
boolean |
matches(int type)
Read a token which must match a given token type. |
int |
read()
Read a token and return the token type. |
String |
read(int type)
Read a token which must match a given token type. |
String |
readRawValue()
Read a value and return the raw Json representation. |
String |
readString()
Read a string. |
void |
resetReader()
Reset the position to 0, so that to restart reading. |
void |
setPos(int pos)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JsopTokenizer(String json,
int pos)
public JsopTokenizer(String json)
| Method Detail |
|---|
public void resetReader()
JsopReader
resetReader in interface JsopReaderpublic String toString()
toString in class Objectpublic int getTokenType()
getTokenType in interface JsopReaderpublic String getToken()
getToken in interface JsopReaderpublic String getEscapedToken()
public String read(int type)
read in interface JsopReadertype - the token type
IllegalStateException - if the token type doesn't matchpublic String readString()
readString in interface JsopReaderIllegalStateException - if the token type doesn't matchpublic boolean matches(int type)
matches in interface JsopReadertype - the token type
public int read()
read in interface JsopReaderpublic static String decodeQuoted(String s)
s - the encoded string, with double quotes
public static String decode(String s)
s - the encoded string, without double quotes
public String readRawValue()
readRawValue in interface JsopReaderpublic int getPos()
public int getLastPos()
public void setPos(int pos)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||