public class JsonPatch
extends java.lang.Object
| Constructor and Description |
|---|
JsonPatch() |
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.JsonNode |
add(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode value,
com.fasterxml.jackson.databind.JsonNode document)
Applies an add operation to a JSON document.
|
static com.fasterxml.jackson.databind.JsonNode |
apply(JsonPatchOperation[] patchOperations,
com.fasterxml.jackson.databind.JsonNode rootDocument)
Performs a series of
JsonPatchOperation on a target JsonNode patch document. |
static com.fasterxml.jackson.databind.JsonNode |
copy(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.core.JsonPointer from,
com.fasterxml.jackson.databind.JsonNode document)
Applies a copy operation to a JSON document.
|
static com.fasterxml.jackson.databind.JsonNode |
move(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.core.JsonPointer from,
com.fasterxml.jackson.databind.JsonNode document)
Applies a move operation to a JSON document.
|
static com.fasterxml.jackson.databind.JsonNode |
remove(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode document)
Applies a remove operation to a JSON document.
|
static com.fasterxml.jackson.databind.JsonNode |
replace(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode value,
com.fasterxml.jackson.databind.JsonNode document)
Applies an replace operation to a JSON document.
|
static void |
test(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode value,
com.fasterxml.jackson.databind.JsonNode document)
Performs a test operation to a JSON document.
|
public static com.fasterxml.jackson.databind.JsonNode apply(JsonPatchOperation[] patchOperations, com.fasterxml.jackson.databind.JsonNode rootDocument) throws JsonPatchFailedException
JsonPatchOperation on a target JsonNode patch document.
Note that the patch document is not modified.patchOperations - the JsonPatchOperation's to be performedrootDocument - the JSON document to be patchedJsonPatchFailedException - if there were any issues applying the patchpublic static com.fasterxml.jackson.databind.JsonNode add(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode value,
com.fasterxml.jackson.databind.JsonNode document)
throws JsonPatchFailedException
path - JsonPointer representation of the target path to perform the add operationvalue - JsonNode representation of value to adddocument - the JSON documentJsonPatchFailedException - if there are any problems patching the documentpublic static com.fasterxml.jackson.databind.JsonNode copy(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.core.JsonPointer from,
com.fasterxml.jackson.databind.JsonNode document)
throws JsonPatchFailedException
path - JsonPointer representation of target path in JSON document to copy source entity tofrom - JsonPointer representation of document path for source entity to copydocument - the JSON documentJsonPatchFailedException - if there are any problems patching the documentpublic static com.fasterxml.jackson.databind.JsonNode move(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.core.JsonPointer from,
com.fasterxml.jackson.databind.JsonNode document)
throws JsonPatchFailedException
path - JsonPointer representation of target path in JSON document to move source entity tofrom - JsonPointer representation of document path for source entity to movedocument - the JSON documentJsonPatchFailedException - if there any problems patching the documentpublic static com.fasterxml.jackson.databind.JsonNode remove(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode document)
throws JsonPatchFailedException
path - JsonPointer representation of target path in JSON document to removedocument - the JSON documentJsonPatchFailedException - if there are any problems patching the documentpublic static com.fasterxml.jackson.databind.JsonNode replace(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode value,
com.fasterxml.jackson.databind.JsonNode document)
throws JsonPatchFailedException
path - JsonPointer representation the target path to perform the replace operationvalue - JsonNode representation of value to replacedocument - the JSON documentJsonPatchFailedException - if there are any problems patching the documentpublic static void test(com.fasterxml.jackson.core.JsonPointer path,
com.fasterxml.jackson.databind.JsonNode value,
com.fasterxml.jackson.databind.JsonNode document)
throws JsonPatchFailedException
path - JsonPointer representation of the target path to perform the test operationvalue - JsonNode representation of value to testdocument - the JSON documentJsonPatchFailedException - if there are any problems patching the document or if the equality test fails.