com.github.fge.jsonpatch.StandardJsonPatchFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-patch Show documentation
Show all versions of json-patch Show documentation
JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java
The newest version!
package com.github.fge.jsonpatch;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.github.fge.jackson.JacksonUtils;
import com.github.fge.jsonpatch.operation.*;
import com.github.fge.msgsimple.bundle.MessageBundle;
import com.github.fge.msgsimple.load.MessageBundles;
import java.io.IOException;
/**
* StandardJsonPatchfactory can create a JsonPatchFactory configured to work with the RFC6902 set of JSON Patch operations.
*/
public class StandardJsonPatchFactory
{
public static JsonPatchFactory create()
{
ObjectMapper mapper = JacksonUtils.newMapper();
mapper.registerModule(new JsonPatchModule());
return new JsonPatchFactory(mapper);
}
}