Package javax.json.spi
Class JsonProvider
java.lang.Object
javax.json.spi.JsonProvider
JsonProvider is the actual implementation of all the Json logic.
A JsonProvider instance can be used concurrently.
It can be accessed via
JsonProvider provider = JsonProvider.provider();
-
Method Summary
Modifier and TypeMethodDescriptionabstract JsonArrayBuilder
createArrayBuilder
(Collection<?> initialData) createArrayBuilder
(JsonArray initialData) abstract JsonBuilderFactory
createBuilderFactory
(Map<String, ?> config) createDiff
(JsonStructure source, JsonStructure target) abstract JsonGenerator
abstract JsonGenerator
createGenerator
(Writer writer) abstract JsonGeneratorFactory
createGeneratorFactory
(Map<String, ?> config) createMergeDiff
(JsonValue source, JsonValue target) Create a merge patch by comparing the source to the target.createMergePatch
(JsonValue patch) Create a merge patch based on the given JsonValue.abstract JsonObjectBuilder
Create an empty JsonObjectBuildercreateObjectBuilder
(Map<String, Object> map) Creates a JSON object builder, initialized with the specified Map.createObjectBuilder
(JsonObject jsonObject) Creates a JSON object builder, initialized with the specified JsonObject.abstract JsonParser
abstract JsonParser
createParser
(Reader reader) abstract JsonParserFactory
createParserFactory
(Map<String, ?> config) createPatch
(JsonArray array) Create a new JsonPatchBuildercreatePatchBuilder
(JsonArray initialData) Create a new JsonPatchBuilder from initial data.createPointer
(String path) Create aJsonPointer
based on the given path stringabstract JsonReader
abstract JsonReader
createReader
(Reader reader) abstract JsonReaderFactory
createReaderFactory
(Map<String, ?> config) createValue
(double value) createValue
(int value) createValue
(long value) createValue
(String value) createValue
(BigDecimal value) createValue
(BigInteger value) abstract JsonWriter
createWriter
(OutputStream out) abstract JsonWriter
createWriter
(Writer writer) abstract JsonWriterFactory
createWriterFactory
(Map<String, ?> config) static JsonProvider
provider()
-
Method Details
-
provider
-
createParser
-
createParser
-
createParserFactory
-
createGenerator
-
createGenerator
-
createGeneratorFactory
-
createReader
-
createReader
-
createWriter
-
createWriter
-
createWriterFactory
-
createReaderFactory
-
createObjectBuilder
Create an empty JsonObjectBuilder- Since:
- 1.0
-
createObjectBuilder
Creates a JSON object builder, initialized with the specified JsonObject.- Since:
- 1.1
-
createObjectBuilder
Creates a JSON object builder, initialized with the specified Map.- Since:
- 1.1
-
createArrayBuilder
-
createArrayBuilder
-
createArrayBuilder
-
createPointer
Create aJsonPointer
based on the given path string- Since:
- 1.1
-
createBuilderFactory
-
createValue
-
createValue
-
createValue
-
createValue
-
createValue
-
createValue
-
createPatch
- Parameters:
array
- with the patch operations- Returns:
- the JsonPatch based on the given operations
- Since:
- 1.1
- See Also:
-
createDiff
Create aJsonPatch
by comparing the source to the target as defined in RFC-6902. Applying thisJsonPatch
to the source you will give you the target.- Since:
- 1.1
- See Also:
-
createPatchBuilder
Create a new JsonPatchBuilder- Since:
- 1.1
-
createPatchBuilder
Create a new JsonPatchBuilder from initial data.- Parameters:
initialData
- the initial patch operations- Since:
- 1.1
-
createMergePatch
Create a merge patch based on the given JsonValue. If you have the following JsonMergePatch:{ "a":"z", "c": { "f": null } }
and apply it to the following JSON{ "a": "b", "c": { "d": "e", "f": "g" } }
you will get the following result:{ "a": "z", "c": { "d": "e", } }
- Since:
- 1.1
- See Also:
-
createMergeDiff
Create a merge patch by comparing the source to the target. Applying this JsonMergePatch to the source will give you the target. A MergePatch is a JsonValue as defined in http://tools.ietf.org/html/rfc7396 If you have a JSON like{ "a": "b", "c": { "d": "e", "f": "g" } }
and comparing it with{ "a": "z", "c": { "d": "e", } }
you will get the following JsonMergePatch:{ "a":"z", "c": { "f": null } }
- Since:
- 1.1
- See Also:
-