Package javax.json
Interface JsonPatch
-
public interface JsonPatchJsonPatch is a format for expressing a sequence of operations to apply on a target JSON document.
A JsonPatch is an array of 'operations' in the form e.g.
[ { "op": "add", "path": "/foo/-", "value": ["abc", "def"] } { "path": "/a/b/c", "op": "add", "value": "foo" } ]The 'operations' are performed in the order they are in the JsonPatch and applied to the 'result' JSON document from the previous operation.
- Since:
- 1.1
- See Also:
JsonPatch.Operation
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classJsonPatch.OperationAn enumeration of available operations forJsonPatch.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends JsonStructure>
Tapply(T target)Applies theJsonPatchto the giventarget.JsonArraytoJsonArray()
-
-
-
Method Detail
-
apply
<T extends JsonStructure> T apply(T target)
Applies theJsonPatchto the giventarget. If the giventargetisnullaNullPointerExceptionwill be thrown.- Parameters:
target- - the target to apply theJsonPatch- Returns:
- 'patched'
JsonStructure - Throws:
java.lang.NullPointerException- iftargetisnull
-
-