public class JSONObjectWriter<T extends net.minidev.json.JSONAware> extends Object implements Consumer<T>
Constructor and Description |
---|
JSONObjectWriter(Writer writer,
KeyExtractor<T> keyExtractor)
Creates a new JSON object writer.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T element) |
void |
writeEnd()
Writes out the closing '}' of the JSON object and closes the writer.
|
void |
writeStart()
Writes out the opening '{' of the JSON object.
|
public JSONObjectWriter(Writer writer, KeyExtractor<T> keyExtractor)
writer
- Writer for the JSON object. Must not be
null
.keyExtractor
- Extracts or determines a JSON object key from
the appended elements. Must not be null
.public void writeStart()
public void writeEnd()
Copyright © 2019 Connect2id. All rights reserved.