Class Parameter


  • public class Parameter
    extends java.lang.Object
    Defines a parameter as passed to a function with late binding support for lazy evaluation.
    • 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()
      • getPath

        public Path getPath()
      • setEvaluated

        public void setEvaluated​(java.lang.Boolean evaluated)
      • hasEvaluated

        public boolean hasEvaluated()
      • 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)
      • 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.