Class Parameter

java.lang.Object
com.jayway.jsonpath.internal.function.Parameter

public class Parameter extends Object
Defines a parameter as passed to a function with late binding support for lazy evaluation.
  • Constructor Details

    • Parameter

      public Parameter()
    • Parameter

      public Parameter(String json)
    • Parameter

      public Parameter(Path path)
  • Method Details

    • getValue

      public Object getValue()
    • setLateBinding

      public void setLateBinding(ILateBindingValue lateBinding)
    • getPath

      public Path getPath()
    • setEvaluated

      public void setEvaluated(Boolean evaluated)
    • hasEvaluated

      public boolean hasEvaluated()
    • getType

      public ParamType getType()
    • setType

      public void setType(ParamType type)
    • setPath

      public void setPath(Path path)
    • getJson

      public String getJson()
    • setJson

      public void setJson(String json)
    • getILateBingValue

      public ILateBindingValue getILateBingValue()
    • toList

      public static <T> List<T> toList(Class<T> type, EvaluationContext ctx, List<Parameter> parameters)
      Translate the collection of parameters into a collection of values of type T.
      Type Parameters:
      T - Type T returned as a List of T.
      Parameters:
      type - The type to translate the collection into.
      ctx - Context.
      parameters - Collection of parameters.
      Returns:
      List of T either empty or containing contents.
    • consume

      public static void consume(Class expectedType, EvaluationContext ctx, Collection collection, Object value)
      Either consume the object as an array and add each element to the collection, or alternatively add each element
      Parameters:
      expectedType - the expected class type to consume, if null or not of this type the element is not added to the array.
      ctx - the JSON context to determine if this is an array or value.
      collection - The collection to append into.
      value - The value to evaluate.