|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.json.JsonConfiguration
public class JsonConfiguration
JSON configuration is a set features that is used to configure the
behaviour of parsing and generation of JSON. The features can be
added to the configuration by chaining the 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 Summary | |
|---|---|
JsonConfiguration()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonConfiguration()
| Method Detail |
|---|
public JsonConfiguration with(JsonFeature feature)
feature to this configuration
public JsonConfiguration withPrettyPrinting()
pretty printing feature
to this configuration
public Iterable<JsonFeature> getFeatures()
Iterable for features in this configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||