public class JsonConfiguration extends Object
with
methods.
For example, JSON can be written in a pretty manner as follows:
JsonObject jsonObject = ...;
JsonConfiguration config = new JsonConfiguration().withPrettyPrinting();
JsonWriter jsonWriter = new JsonWriter(..., config);
jsonWriter.writeObject(jsonObject);
jsonWriter.close();
Constructor and Description |
---|
JsonConfiguration() |
Modifier and Type | Method and Description |
---|---|
Iterable<JsonFeature> |
getFeatures()
Returns a
Iterable for features in this configuration. |
JsonConfiguration |
with(JsonFeature feature)
Adds a
feature to this configuration |
JsonConfiguration |
withPrettyPrinting()
Adds
pretty printing feature
to this configuration |
public JsonConfiguration with(JsonFeature feature)
feature
to this configurationpublic JsonConfiguration withPrettyPrinting()
pretty printing
feature
to this configurationpublic Iterable<JsonFeature> getFeatures()
Iterable
for features in this configuration.Copyright © 2013. All Rights Reserved.