Class Parameter
- java.lang.Object
-
- com.jayway.jsonpath.internal.function.Parameter
-
public class Parameter extends java.lang.Object
Defines a parameter as passed to a function with late binding support for lazy evaluation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
consume(java.lang.Class expectedType, EvaluationContext ctx, java.util.Collection collection, java.lang.Object value)
Either consume the object as an array and add each element to the collection, or alternatively add each elementILateBindingValue
getILateBingValue()
java.lang.String
getJson()
Path
getPath()
ParamType
getType()
java.lang.Object
getValue()
boolean
hasEvaluated()
void
setEvaluated(java.lang.Boolean evaluated)
void
setJson(java.lang.String json)
void
setLateBinding(ILateBindingValue lateBinding)
void
setPath(Path path)
void
setType(ParamType type)
static <T> java.util.List<T>
toList(java.lang.Class<T> type, EvaluationContext ctx, java.util.List<Parameter> parameters)
Translate the collection of parameters into a collection of values of type T.
-
-
-
Constructor Detail
-
Parameter
public Parameter()
-
Parameter
public Parameter(java.lang.String json)
-
Parameter
public Parameter(Path path)
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
-
setLateBinding
public void setLateBinding(ILateBindingValue lateBinding)
-
getPath
public Path getPath()
-
setEvaluated
public void setEvaluated(java.lang.Boolean evaluated)
-
hasEvaluated
public boolean hasEvaluated()
-
getType
public ParamType getType()
-
setType
public void setType(ParamType type)
-
setPath
public void setPath(Path path)
-
getJson
public java.lang.String getJson()
-
setJson
public void setJson(java.lang.String json)
-
getILateBingValue
public ILateBindingValue getILateBingValue()
-
toList
public static <T> java.util.List<T> toList(java.lang.Class<T> type, EvaluationContext ctx, java.util.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(java.lang.Class expectedType, EvaluationContext ctx, java.util.Collection collection, java.lang.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.
-
-