| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final BasicJsonWriter. |
| Access | Constructor and Description |
|---|---|
| public | BasicJsonWriter(Writer
the writer to use writer, String the value of one indent singleIndent)Create a new instance with the specified indent value. |
| public | BasicJsonWriter(Writer
the writer to use writer)Create a new instance using two whitespaces for the indent. |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private String | |
| private <T> Runnable | |
| public void | |
| private void | |
| private void | |
| public void | writeObject(Map<String, Object>
the attributes of the object attributes)Write an object with the specified attributes. |
| private void | |
| private void |
| writer | back to summary |
|---|---|
| private final BasicJsonWriter. | |
| BasicJsonWriter | back to summary |
|---|---|
| public BasicJsonWriter(Writer writer, String singleIndent) Create a new instance with the specified indent value. | |
| BasicJsonWriter | back to summary |
|---|---|
| public BasicJsonWriter(Writer writer) Create a new instance using two whitespaces for the indent.
| |
| escape | back to summary |
|---|---|
| private static String escape(CharSequence input) | |
| quote | back to summary |
|---|---|
| private String quote(String name) | |
| writeAll | back to summary |
|---|---|
| private <T> Runnable writeAll(Iterator<T> it, Consumer<T> writer) | |
| writeArray | back to summary |
|---|---|
| public void writeArray(List<?> items) Write an array with the specified items. Each item in the list is written either as a nested object or as an attribute depending on its type.
| |
| writeArray | back to summary |
|---|---|
| private void writeArray(List<?> items, boolean newLine) | |
| writeAttribute | back to summary |
|---|---|
| private void writeAttribute(String name, Object value) | |
| writeObject | back to summary |
|---|---|
| public void writeObject(Map<String, Object> attributes) Write an object with the specified attributes. Each attribute is written according to its value type:
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(Map<String, Object> attributes, boolean newLine) | |
| writeValue | back to summary |
|---|---|
private void writeValue(Object value)
| |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private int | |
| private final Writer | |
| private boolean | |
| private final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| 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. |
| private BasicJsonWriter. | |
| public BasicJsonWriter. | |
| private BasicJsonWriter. | |
| public BasicJsonWriter. | |
| public BasicJsonWriter. | |
| public BasicJsonWriter. | |
| private BasicJsonWriter. | |
| public void | write(char[]
Array of characters chars, int Offset from which to start writing characters offset, int Number of characters to write length)Implements abstract java. Writes a portion of an array of characters. |
| currentIndent | back to summary |
|---|---|
| private String currentIndent | |
| level | back to summary |
|---|---|
| private int level | |
| out | back to summary |
|---|---|
| private final Writer out | |
| prependIndent | back to summary |
|---|---|
| private boolean prependIndent | |
| singleIndent | back to summary |
|---|---|
| private final String singleIndent | |
| IndentingWriter | back to summary |
|---|---|
| pack-priv IndentingWriter(Writer out, String singleIndent) | |
| 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.
| |
| indent | back to summary |
|---|---|
| private BasicJsonWriter. Increase the indentation level. | |
| indented | back to summary |
|---|---|
| public BasicJsonWriter. Increase the indentation level and execute the
| |
| outdent | back to summary |
|---|---|
| private BasicJsonWriter. Decrease the indentation level. | |
| back to summary | |
|---|---|
| public BasicJsonWriter. Write the specified text.
| |
| println | back to summary |
|---|---|
| public BasicJsonWriter. Write the specified text and append a new line.
| |
| println | back to summary |
|---|---|
| public BasicJsonWriter. Write a new line. | |
| refreshIndent | back to summary |
|---|---|
| private BasicJsonWriter. | |
| write | back to summary |
|---|---|
| public void write(char[] chars, int offset, int length) Implements abstract java. Doc from java. Writes a portion of an array of characters.
| |