public static class Json.DefaultFactory extends Object implements Json.Factory
| Constructor and Description |
|---|
DefaultFactory() |
| Modifier and Type | Method and Description |
|---|---|
Json |
array()
Construct and return a JSON object.
|
Json |
bool(boolean x)
Construct and return a JSON boolean.
|
Json |
make(Object anything)
Construct and return a JSON object.
|
Json |
nil()
Construct and return an object representing JSON
null. |
Json |
number(Number x)
Construct and return a JSON number.
|
Json |
object()
Construct and return a JSON object.
|
Json |
string(String x)
Construct and return a JSON string.
|
public Json nil()
Json.Factorynull. Implementations are
free to cache a return the same instance. The resulting value must return
true from isNull() and null from
getValue().nil in interface Json.Factorynull value.public Json bool(boolean x)
Json.Factorytrue from isBoolean() and the passed
in parameter from getValue().bool in interface Json.Factoryx - The boolean value.isBoolean() == true. Implementations
are free to cache and return the same instance for true and false.public Json string(String x)
Json.Factorytrue from isString() and the passed
in parameter from getValue().string in interface Json.Factoryx - The string to wrap as a JSON value.public Json number(Number x)
Json.Factorytrue from isNumber() and the passed
in parameter from getValue().number in interface Json.Factoryx - The numeric value.public Json array()
Json.Factorytrue from isArray() and an implementation
of java.util.List from getValue().array in interface Json.Factorypublic Json object()
Json.Factorytrue from isObject() and an implementation
of java.util.Map from getValue().object in interface Json.Factorypublic Json make(Object anything)
Json.FactoryJson
instance.make in interface Json.Factoryanything - An arbitray Java object from which to construct a Json
element.Json instance.Copyright © 2019 JBoss by Red Hat. All rights reserved.