public class JSONArrayWriter<T extends net.minidev.json.JSONAware> extends Object implements Appendable<T>
Constructor and Description |
---|
JSONArrayWriter(Writer writer)
Creates a new JSON array writer.
|
JSONArrayWriter(Writer writer,
boolean noDuplicates)
Creates a new JSON array writer.
|
Modifier and Type | Method and Description |
---|---|
void |
append(T element)
Appends the specified element.
|
void |
writeEnd()
Writes out the closing ']' of the JSON array and closes the writer.
|
void |
writeStart()
Writes out the opening '[' of the JSON array.
|
public JSONArrayWriter(Writer writer)
writer
- Writer for the JSON array. Must not be null
.public JSONArrayWriter(Writer writer, boolean noDuplicates)
writer
- Writer for the JSON array. Must not be
null
.noDuplicates
- true
to ensure no duplicates are written
to the JSON array.public void writeStart()
public void append(T element)
Appendable
append
in interface Appendable<T extends net.minidev.json.JSONAware>
element
- The element to append. May be null
.public void writeEnd()
Copyright © 2015 Connect2id. All Rights Reserved.