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 JsonArrayBuildercreateArrayBuilder(Collection<?> initialData) createArrayBuilder(JsonArray initialData) abstract JsonBuilderFactorycreateBuilderFactory(Map<String, ?> config) createDiff(JsonStructure source, JsonStructure target) abstract JsonGeneratorabstract JsonGeneratorcreateGenerator(Writer writer) abstract JsonGeneratorFactorycreateGeneratorFactory(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 JsonObjectBuilderCreate 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 JsonParserabstract JsonParsercreateParser(Reader reader) abstract JsonParserFactorycreateParserFactory(Map<String, ?> config) createPatch(JsonArray array) Create a new JsonPatchBuildercreatePatchBuilder(JsonArray initialData) Create a new JsonPatchBuilder from initial data.createPointer(String path) Create aJsonPointerbased on the given path stringabstract JsonReaderabstract JsonReadercreateReader(Reader reader) abstract JsonReaderFactorycreateReaderFactory(Map<String, ?> config) createValue(double value) createValue(int value) createValue(long value) createValue(String value) createValue(BigDecimal value) createValue(BigInteger value) abstract JsonWritercreateWriter(OutputStream out) abstract JsonWritercreateWriter(Writer writer) abstract JsonWriterFactorycreateWriterFactory(Map<String, ?> config) static JsonProviderprovider()
-
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 aJsonPointerbased 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 aJsonPatchby comparing the source to the target as defined in RFC-6902. Applying thisJsonPatchto 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:
-