public class JsopStream extends java.lang.Object implements JsopReader, JsopWriter
COMMENT, END, ERROR, FALSE, IDENTIFIER, NULL, NUMBER, STRING, TRUE| Constructor and Description |
|---|
JsopStream() |
| Modifier and Type | Method and Description |
|---|---|
JsopStream |
append(JsopWriter w)
Append all entries of the given writer.
|
JsopStream |
array()
Append '['.
|
JsopStream |
encodedValue(java.lang.String raw)
Append an already encoded value.
|
JsopStream |
endArray()
Append ']'.
|
JsopStream |
endObject()
Append '}'.
|
java.lang.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(java.lang.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.
|
java.lang.String |
read(int type)
Read a token which must match a given token type.
|
java.lang.String |
readRawValue()
Return the row (escaped) token.
|
java.lang.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.
|
java.lang.String |
toString() |
JsopStream |
value(boolean b)
Append the boolean value 'true' or 'false'.
|
JsopStream |
value(long x)
Append a number.
|
JsopStream |
value(java.lang.String value)
Append a string or null.
|
public JsopStream append(JsopWriter w)
JsopWriterappend in interface JsopWriterw - the writerpublic JsopStream tag(char tag)
JsopWritertag in interface JsopWritertag - the string to appendpublic JsopStream array()
JsopWriterarray in interface JsopWriterpublic JsopStream encodedValue(java.lang.String raw)
JsopWriterencodedValue in interface JsopWriterraw - the valuepublic JsopStream endArray()
JsopWriterendArray in interface JsopWriterpublic JsopStream endObject()
JsopWriterendObject in interface JsopWriterpublic JsopStream key(java.lang.String key)
JsopWriterkey in interface JsopWriterkey - the keypublic JsopStream newline()
JsopWriternewline in interface JsopWriterpublic JsopStream object()
JsopWriterobject in interface JsopWriterpublic JsopStream value(java.lang.String value)
JsopWritervalue in interface JsopWritervalue - the valuepublic JsopStream value(long x)
JsopWritervalue in interface JsopWriterx - the valuepublic JsopStream value(boolean b)
JsopWritervalue in interface JsopWriterb - the valuepublic void resetReader()
JsopReaderresetReader in interface JsopReaderpublic void resetWriter()
JsopWriterresetWriter in interface JsopWriterpublic void setLineLength(int i)
JsopWritersetLineLength in interface JsopWriteri - the lengthpublic java.lang.String getToken()
JsopReadergetToken in interface JsopReaderpublic int getTokenType()
JsopReadergetTokenType in interface JsopReaderpublic boolean matches(int type)
JsopReadermatches in interface JsopReadertype - the token typepublic java.lang.String read(int type)
JsopReaderread in interface JsopReadertype - the token typepublic int read()
JsopReaderread in interface JsopReaderpublic java.lang.String readRawValue()
JsopReaderreadRawValue in interface JsopReaderpublic java.lang.String readString()
JsopReaderreadString in interface JsopReaderpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved