com.github.fge.jsonpatch
Class JsonPatchOperation

java.lang.Object
  extended by com.github.fge.jsonpatch.JsonPatchOperation
All Implemented Interfaces:
JsonSerializable
Direct Known Subclasses:
DualPathOperation, PathValueOperation, RemoveOperation

public abstract class JsonPatchOperation
extends Object
implements JsonSerializable


Field Summary
protected static MessageBundle BUNDLE
           
protected  String op
           
protected  JsonPointer path
           
 
Constructor Summary
protected JsonPatchOperation(String op, JsonPointer path)
          Constructor
 
Method Summary
abstract  JsonNode apply(JsonNode node)
          Apply this operation to a JSON value
abstract  String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.fasterxml.jackson.databind.JsonSerializable
serialize, serializeWithType
 

Field Detail

BUNDLE

protected static final MessageBundle BUNDLE

op

protected final String op

path

protected final JsonPointer path
Constructor Detail

JsonPatchOperation

protected JsonPatchOperation(String op,
                             JsonPointer path)
Constructor

Parameters:
op - the operation name
path - the JSON Pointer for this operation
Method Detail

apply

public abstract JsonNode apply(JsonNode node)
                        throws JsonPatchException
Apply this operation to a JSON value

Parameters:
node - the value to patch
Returns:
the patched value
Throws:
JsonPatchException - operation failed to apply to this value

toString

public abstract String toString()
Overrides:
toString in class Object