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 Details

    • op

      protected final String op
    • path

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

      protected final 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, Object value)
  • Method Details

    • evaluateValueFromTarget

      protected 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 Object evaluate(Class<?> type)