Class PatchOperation

java.lang.Object
org.springframework.data.rest.webmvc.json.patch.PatchOperation

public abstract class PatchOperation extends Object
Abstract base class representing and providing support methods for patch operations.
Author:
Craig Walls, Mathias Düsterhöft, Oliver Gierke
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     
    protected final org.springframework.data.rest.webmvc.json.patch.SpelPath.UntypedSpelPath
     
    protected final @Nullable Object
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    PatchOperation(String op, org.springframework.data.rest.webmvc.json.patch.SpelPath.UntypedSpelPath path)
    Constructs the operation.
    protected
    PatchOperation(String op, org.springframework.data.rest.webmvc.json.patch.SpelPath.UntypedSpelPath path, @Nullable Object value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final @Nullable Object
    evaluate(Class<?> type)
     
    protected @Nullable Object
    evaluateValueFromTarget(Object targetObject, Class<?> entityType, BindContext context)
    Performs late-value evaluation on the operation value if the value is a LateObjectEvaluator.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • op

      protected final String op
    • path

      protected final org.springframework.data.rest.webmvc.json.patch.SpelPath.UntypedSpelPath path
    • value

      protected final @Nullable Object value
  • Constructor Details

    • PatchOperation

      public PatchOperation(String op, org.springframework.data.rest.webmvc.json.patch.SpelPath.UntypedSpelPath path)
      Constructs the operation.
      Parameters:
      op - the operation name. (e.g., 'move')
      path - the path to perform the operation on. (e.g., '/1/description')
    • PatchOperation

      protected PatchOperation(String op, org.springframework.data.rest.webmvc.json.patch.SpelPath.UntypedSpelPath path, @Nullable Object value)
  • Method Details

    • evaluateValueFromTarget

      protected @Nullable Object evaluateValueFromTarget(Object targetObject, Class<?> entityType, BindContext context)
      Performs late-value evaluation on the operation value if the value is a LateObjectEvaluator.
      Parameters:
      targetObject - the target object, used as assistance in determining the evaluated object's type.
      entityType - the entityType
      Returns:
      the result of late-value evaluation if the value is a LateObjectEvaluator; the value itself otherwise.
    • evaluate

      protected final @Nullable Object evaluate(Class<?> type)