com.github.fge.jsonpatch
Class RemoveOperation

java.lang.Object
  extended by com.github.fge.jsonpatch.JsonPatchOperation
      extended by com.github.fge.jsonpatch.RemoveOperation
All Implemented Interfaces:
JsonSerializable

public final class RemoveOperation
extends JsonPatchOperation

JSON Path remove operation

This operation only takes one pointer (path) as an argument. It is an error condition if no JSON value exists at that pointer.


Field Summary
 
Fields inherited from class com.github.fge.jsonpatch.JsonPatchOperation
BUNDLE, op, path
 
Constructor Summary
RemoveOperation(JsonPointer path)
           
 
Method Summary
 JsonNode apply(JsonNode node)
          Apply this operation to a JSON value
 void serialize(JsonGenerator jgen, SerializerProvider provider)
           
 void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoveOperation

public RemoveOperation(JsonPointer path)
Method Detail

apply

public JsonNode apply(JsonNode node)
               throws JsonPatchException
Description copied from class: JsonPatchOperation
Apply this operation to a JSON value

Specified by:
apply in class JsonPatchOperation
Parameters:
node - the value to patch
Returns:
the patched value
Throws:
JsonPatchException - operation failed to apply to this value

serialize

public void serialize(JsonGenerator jgen,
                      SerializerProvider provider)
               throws IOException,
                      JsonProcessingException
Throws:
IOException
JsonProcessingException

serializeWithType

public void serializeWithType(JsonGenerator jgen,
                              SerializerProvider provider,
                              TypeSerializer typeSer)
                       throws IOException,
                              JsonProcessingException
Throws:
IOException
JsonProcessingException

toString

public String toString()
Specified by:
toString in class JsonPatchOperation