Class JsonPrettyGeneratorImpl
java.lang.Object
org.glassfish.json.JsonGeneratorImpl
org.glassfish.json.JsonPrettyGeneratorImpl
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, JsonGenerator
-
Field Summary
FieldsFields inherited from interface JsonGenerator
PRETTY_PRINTING -
Constructor Summary
ConstructorsConstructorDescriptionJsonPrettyGeneratorImpl(OutputStream out, Charset encoding, BufferPool bufferPool) JsonPrettyGeneratorImpl(OutputStream out, BufferPool bufferPool) JsonPrettyGeneratorImpl(Writer writer, BufferPool bufferPool) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidwriteEnd()Writes the end of the current context.private voidprivate voidWrites the JSON start array character.writeStartArray(String name) Writes the JSON name/start array character pair with in the current object context.Writes the JSON start object character.writeStartObject(String name) Writes the JSON name/start object character pair in the current object context.Methods inherited from class JsonGeneratorImpl
close, flush, flushBuffer, isCommaAllowed, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeChar, writeEscapedString, writeInt, writeKey, writeNull, writeNull, writeString, writeString
-
Field Details
-
indentLevel
private int indentLevel -
INDENT
- See Also:
-
-
Constructor Details
-
JsonPrettyGeneratorImpl
-
JsonPrettyGeneratorImpl
-
JsonPrettyGeneratorImpl
-
-
Method Details
-
writeStartObject
Description copied from interface:JsonGeneratorWrites the JSON start object character. It starts a new child object context within which JSON name/value pairs can be written to the object. This method is valid only in an array context, field context or in no context (when a context is not yet started). This method can only be called once in no context.- Specified by:
writeStartObjectin interfaceJsonGenerator- Overrides:
writeStartObjectin classJsonGeneratorImpl- Returns:
- this generator
-
writeStartObject
Description copied from interface:JsonGeneratorWrites the JSON name/start object character pair in the current object context. It starts a new child object context within which JSON name/value pairs can be written to the object.- Specified by:
writeStartObjectin interfaceJsonGenerator- Overrides:
writeStartObjectin classJsonGeneratorImpl- Parameters:
name- a name within the JSON name/object pair to be written- Returns:
- this generator
-
writeStartArray
Description copied from interface:JsonGeneratorWrites the JSON start array character. It starts a new child array context within which JSON values can be written to the array. This method is valid only in an array context, field context or in no context (when a context is not yet started). This method can only be called once in no context.- Specified by:
writeStartArrayin interfaceJsonGenerator- Overrides:
writeStartArrayin classJsonGeneratorImpl- Returns:
- this generator
-
writeStartArray
Description copied from interface:JsonGeneratorWrites the JSON name/start array character pair with in the current object context. It starts a new child array context within which JSON values can be written to the array.- Specified by:
writeStartArrayin interfaceJsonGenerator- Overrides:
writeStartArrayin classJsonGeneratorImpl- Parameters:
name- a name within the JSON name/array pair to be written- Returns:
- this generator
-
writeEnd
Description copied from interface:JsonGeneratorWrites the end of the current context. If the current context is an array context, this method writes the end-of-array character (']'). If the current context is an object context, this method writes the end-of-object character ('}'). After writing the end of the current context, the parent context becomes the new current context. If parent context is field context, it is closed.- Specified by:
writeEndin interfaceJsonGenerator- Overrides:
writeEndin classJsonGeneratorImpl- Returns:
- this generator
-
writeIndent
private void writeIndent() -
writeComma
protected void writeComma()- Overrides:
writeCommain classJsonGeneratorImpl
-
writeColon
protected void writeColon()- Overrides:
writeColonin classJsonGeneratorImpl
-
writeNewLine
private void writeNewLine()
-