Class Converters

    • Method Detail

      • stringValue

        public static String stringValue​(Evaluator.EvaluationContext evaluationContext,
                                         TreeNode node,
                                         String defaultValue)
        Evaluates a TreeNode to find eventual String value.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        Evaluated value on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • numericValue

        public static Number numericValue​(Evaluator.EvaluationContext evaluationContext,
                                          TreeNode node,
                                          Number defaultValue)
        Evaluates a TreeNode to find eventual numeric value.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        Evaluated value on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • booleanValue

        public static Boolean booleanValue​(Evaluator.EvaluationContext evaluationContext,
                                           TreeNode node,
                                           boolean defaultValue)
        Evaluates a TreeNode to find eventual boolean value.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        Evaluated value on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • explodeArray

        public static List<Value> explodeArray​(Evaluator.EvaluationContext evaluationContext,
                                               TreeNode node,
                                               List<Value> defaultValue)
        Evaluates a TreeNode to find eventual array.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        Evaluated array on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • flattenArray

        public static List<Object> flattenArray​(Evaluator.EvaluationContext evaluationContext,
                                                Value value,
                                                Object defaultValue)
        Flatten an ArrayNode into List of objects
        Parameters:
        evaluationContext - Current eval context
        value - Value that evaluates to an array
        defaultValue - Default value if eval fails
        Returns:
        Evaluated list on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • jsonPathValue

        public static String jsonPathValue​(Evaluator.EvaluationContext evaluationContext,
                                           TreeNode node,
                                           String defaultValue)
        Evaluates a TreeNode to find eventual json path value.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        provided json path on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • jsonPointerValue

        public static String jsonPointerValue​(Evaluator.EvaluationContext evaluationContext,
                                              TreeNode node,
                                              String defaultValue)
        Evaluates a TreeNode to find eventual json pointer value.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        provided json path on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy
      • objectValue

        public static Object objectValue​(Evaluator.EvaluationContext evaluationContext,
                                         TreeNode node,
                                         Object defaultValue)
        Evaluates a TreeNode to find eventual object.
        Parameters:
        evaluationContext - Current eval context
        node - Node to be evaluated
        defaultValue - Default value if eval fails
        Returns:
        Evaluated object on success, defaultValue or excption in case of failure depending on ErrorHandlingStrategy