public final class PrettyWriterFactory extends java.lang.Object implements StructureWriterFactory
StructureWriter
s for pretty-print
JSON output. Parameterized by indent factor and initial indent.Constructor and Description |
---|
PrettyWriterFactory(int indentFactor)
Create a new factory for pretty-printing with the given indent factor.
|
PrettyWriterFactory(int indentFactor,
int indent)
Create a new factory for pretty-printing with the given indent factor
and initial indentation.
|
Modifier and Type | Method and Description |
---|---|
StructureWriter |
newArrayWriter(StructureWriter parentWriter)
Returns a
StructureWriter for writing pretty-printed JSON Array
structures. |
StructureWriter |
newObjectWriter(StructureWriter parentWriter)
Returns a
StructureWriter for writing pretty-printed JSON Object
structures. |
public PrettyWriterFactory(int indentFactor)
indentFactor
- the number of spaces for each indent levelpublic PrettyWriterFactory(int indentFactor, int indent)
indentFactor
- the number of spaces for each indent levelindent
- the initial indentation levelpublic StructureWriter newArrayWriter(StructureWriter parentWriter)
StructureWriter
for writing pretty-printed JSON Array
structures.newArrayWriter
in interface StructureWriterFactory
parentWriter
- parameters passed in from the parent writerStructureWriter
for writing a pretty-print JSON Array
structurepublic StructureWriter newObjectWriter(StructureWriter parentWriter)
StructureWriter
for writing pretty-printed JSON Object
structures.newObjectWriter
in interface StructureWriterFactory
parentWriter
- parameters passed in from the parent writerStructureWriter
for writing a pretty-print JSON Object
structure