|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.mk.json.JsopTokenizer
public class JsopTokenizer
A tokenizer for Json and Jsop strings.
| Field Summary | |
|---|---|
static int |
COMMENT
|
static int |
END
|
static int |
ERROR
|
static int |
FALSE
|
static int |
IDENTIFIER
|
static int |
NULL
|
static int |
NUMBER
|
static int |
STRING
|
static int |
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()
|
void |
setPos(int pos)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int END
public static final int STRING
public static final int NUMBER
public static final int TRUE
public static final int FALSE
public static final int NULL
public static final int ERROR
public static final int IDENTIFIER
public static final int COMMENT
| Constructor Detail |
|---|
public JsopTokenizer(String json,
int pos)
public JsopTokenizer(String json)
| Method Detail |
|---|
public void resetReader()
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 | |||||||||