Writer.
| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private int | |
| private static final int | |
| private boolean | |
| private static final int | |
| private static final int | |
| private static final int | |
| private JsonWriter. | |
| private boolean | |
| private final IntArray | |
| pack-priv Writer |
| Access | Constructor and Description |
|---|---|
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public JsonWriter | |
| public JsonWriter | |
| public void | close()
Implements abstract java. Implements java. Closes the stream, flushing it first. |
| public void | flush()
Implements abstract java. Implements java. Flushes the stream. |
| public Writer | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| private void | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| private void | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public void | |
| public void | setQuoteLongValues(boolean quoteLongValues)
When true, long, double, BigInteger, BigDecimal types are output as strings to prevent truncation in languages like JavaScript and PHP. |
| public void | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public JsonWriter | |
| public void | write(char[] cbuf, int off, int len)
Implements abstract java. Writes a portion of an array of characters. |
| array | back to summary |
|---|---|
| private static final int array | |
| current | back to summary |
|---|---|
| private int current | |
| isObject | back to summary |
|---|---|
| private static final int isObject | |
| named | back to summary |
|---|---|
| private boolean named | |
| needsComma | back to summary |
|---|---|
| private static final int needsComma | |
| none | back to summary |
|---|---|
| private static final int none | |
| object | back to summary |
|---|---|
| private static final int object | |
| outputType | back to summary |
|---|---|
| private JsonWriter. | |
| quoteLongValues | back to summary |
|---|---|
| private boolean quoteLongValues | |
| stack | back to summary |
|---|---|
| private final IntArray stack | |
| writer | back to summary |
|---|---|
| pack-priv Writer writer | |
| JsonWriter | back to summary |
|---|---|
| public JsonWriter(Writer writer) | |
| JsonWriter | back to summary |
|---|---|
| protected JsonWriter() A writer must be set before use. | |
| array | back to summary |
|---|---|
| public JsonWriter array() throws IOException | |
| array | back to summary |
|---|---|
| public JsonWriter array(String name) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract java. Implements java. Doc from java. Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams. If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| getWriter | back to summary |
|---|---|
| public Writer getWriter() | |
| json | back to summary |
|---|---|
| public JsonWriter json(String json) throws IOException Writes the specified JSON string, without quoting or escaping. | |
| json | back to summary |
|---|---|
| public JsonWriter json(String name, String json) throws IOException Writes the specified JSON string, without quoting or escaping. | |
| name | back to summary |
|---|---|
| public JsonWriter name(String name) throws IOException | |
| nameValue | back to summary |
|---|---|
| private void nameValue(String name) throws IOException | |
| object | back to summary |
|---|---|
| public JsonWriter object() throws IOException | |
| object | back to summary |
|---|---|
| public JsonWriter object(String name) throws IOException | |
| pop | back to summary |
|---|---|
| public JsonWriter pop() throws IOException | |
| requireCommaOrName | back to summary |
|---|---|
| private void requireCommaOrName() throws IOException | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, Object value) throws IOException Prefer calling the more specific set() methods. | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, String value) throws IOException | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, boolean value) throws IOException | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, int value) throws IOException | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, long value) throws IOException | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, float value) throws IOException | |
| set | back to summary |
|---|---|
| public JsonWriter set(String name, double value) throws IOException | |
| setOutputType | back to summary |
|---|---|
| public void setOutputType(JsonWriter. Sets the type of JSON output. Default is | |
| setQuoteLongValues | back to summary |
|---|---|
| public void setQuoteLongValues(boolean quoteLongValues) When true, long, double, BigInteger, BigDecimal types are output as strings to prevent truncation in languages like JavaScript and PHP. This is not necessary when using libgdx, which handles these types without truncation. Default is false. | |
| setWriter | back to summary |
|---|---|
| public void setWriter(Writer writer) | |
| value | back to summary |
|---|---|
| public JsonWriter value(Object value) throws IOException Prefer calling the more specific value() methods. | |
| value | back to summary |
|---|---|
| public JsonWriter value(String value) throws IOException | |
| value | back to summary |
|---|---|
| public JsonWriter value(boolean value) throws IOException | |
| value | back to summary |
|---|---|
| public JsonWriter value(int value) throws IOException | |
| value | back to summary |
|---|---|
| public JsonWriter value(long value) throws IOException | |
| value | back to summary |
|---|---|
| public JsonWriter value(float value) throws IOException | |
| value | back to summary |
|---|---|
| public JsonWriter value(double value) throws IOException | |
| write | back to summary |
|---|---|
| public void write(char[] cbuf, int off, int len) throws IOException Implements abstract java. Doc from java. Writes a portion of an array of characters.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final JsonWriter. | javascript
Like JSON, but names are only double quoted if necessary. |
| private static final Pattern | |
| public static final JsonWriter. | json
Normal JSON, with all its double quotes. |
| public static final JsonWriter. | minimal
Like JSON, but:
|
| private static final Pattern | |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private static String | |
| public String | |
| public String | |
| public static JsonWriter. | |
| public static JsonWriter. |
| javascript | back to summary |
|---|---|
| public static final JsonWriter. Like JSON, but names are only double quoted if necessary. | |
| javascriptPattern | back to summary |
|---|---|
| private static final Pattern javascriptPattern | |
| json | back to summary |
|---|---|
| public static final JsonWriter. Normal JSON, with all its double quotes. | |
| minimal | back to summary |
|---|---|
| public static final JsonWriter. Like JSON, but:
| |
| minimalNamePattern | back to summary |
|---|---|
| private static final Pattern minimalNamePattern | |
| minimalValuePattern | back to summary |
|---|---|
| private static final Pattern minimalValuePattern | |
| OutputType | back to summary |
|---|---|
| private OutputType() | |
| escape | back to summary |
|---|---|
| private static String escape(String value, int i) | |
| escapeQuote | back to summary |
|---|---|
| private static String escapeQuote(String value) | |
| quoteName | back to summary |
|---|---|
| public String quoteName(String value) | |
| quoteValue | back to summary |
|---|---|
| public String quoteValue(Object value) | |
| valueOf | back to summary |
|---|---|
| public static JsonWriter. | |
| values | back to summary |
|---|---|
| public static JsonWriter. | |