|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.mk.json.JsopStream
public class JsopStream
A fast Jsop writer / reader.
| Field Summary |
|---|
| Fields inherited from interface org.apache.jackrabbit.mk.json.JsopReader |
|---|
COMMENT, END, ERROR, FALSE, IDENTIFIER, NULL, NUMBER, STRING, TRUE |
| Constructor Summary | |
|---|---|
JsopStream()
|
|
| Method Summary | |
|---|---|
JsopStream |
append(JsopWriter w)
Append all entries of the given buffer. |
JsopStream |
array()
Append '['. |
JsopStream |
encodedValue(String raw)
Append an already encoded value. |
JsopStream |
endArray()
Append ']'. |
JsopStream |
endObject()
Append '}'. |
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. |
JsopStream |
key(String key)
Append the key (in quotes) plus a colon. |
boolean |
matches(int type)
Read a token which must match a given token type. |
JsopStream |
newline()
Append a newline character. |
JsopStream |
object()
Append '{'. |
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()
Return the row (escaped) token. |
String |
readString()
Read a string. |
void |
resetReader()
Reset the position to 0, so that to restart reading. |
void |
resetWriter()
Resets this instance, so that all data is discarded. |
void |
setLineLength(int i)
Set the line length, after which a newline is added (to improve readability). |
JsopStream |
tag(char tag)
Append a Jsop tag character. |
String |
toString()
|
JsopStream |
value(boolean b)
Append the boolean value 'true' or 'false'. |
JsopStream |
value(long x)
Append a number. |
JsopStream |
value(String value)
Append a string or null. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JsopStream()
| Method Detail |
|---|
public JsopStream append(JsopWriter w)
JsopWriter
append in interface JsopWriterpublic JsopStream tag(char tag)
JsopWriter
tag in interface JsopWritertag - the string to append
public JsopStream array()
JsopWriter
array in interface JsopWriterpublic JsopStream encodedValue(String raw)
JsopWriter
encodedValue in interface JsopWriterpublic JsopStream endArray()
JsopWriter
endArray in interface JsopWriterpublic JsopStream endObject()
JsopWriter
endObject in interface JsopWriterpublic JsopStream key(String key)
JsopWriter
key in interface JsopWriterpublic JsopStream newline()
JsopWriter
newline in interface JsopWriterpublic JsopStream object()
JsopWriter
object in interface JsopWriterpublic JsopStream value(String value)
JsopWriter
value in interface JsopWritervalue - the value
public JsopStream value(long x)
JsopWriter
value in interface JsopWriterpublic JsopStream value(boolean b)
JsopWriter
value in interface JsopWriterpublic void resetReader()
JsopReader
resetReader in interface JsopReaderpublic void resetWriter()
JsopWriter
resetWriter in interface JsopWriterpublic void setLineLength(int i)
JsopWriter
setLineLength in interface JsopWriteri - the lengthpublic String getToken()
JsopReader
getToken in interface JsopReaderpublic int getTokenType()
JsopReader
getTokenType in interface JsopReaderpublic boolean matches(int type)
JsopReader
matches in interface JsopReadertype - the token type
public String read(int type)
JsopReader
read in interface JsopReadertype - the token type
public int read()
JsopReader
read in interface JsopReaderpublic String readRawValue()
JsopReader
readRawValue in interface JsopReaderpublic String readString()
JsopReader
readString in interface JsopReaderpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||