com.amazonaws.jmespath

## Class JmesPathEvaluationVisitor

- java.lang.Object
- - com.amazonaws.jmespath.JmesPathEvaluationVisitor

All Implemented Interfaces:
  JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>

    public class JmesPathEvaluationVisitor
    extends Object
    implements JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>

### Constructor Summary

Constructors
Constructor and Description
`JmesPathEvaluationVisitor()`

### Method Summary

All Methods Instance Methods Concrete Methods
`com.fasterxml.jackson.databind.JsonNode` `visit(Comparator op, com.fasterxml.jackson.databind.JsonNode input)` Evaluate the expressions as per the given comparison operator.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathAndExpression andExpression, com.fasterxml.jackson.databind.JsonNode input)` And expression will evaluate to either the left expression or the right expression.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathField fieldNode, com.fasterxml.jackson.databind.JsonNode input)` Retrieves the value of the field node
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathFilter filter, com.fasterxml.jackson.databind.JsonNode input)` Evaluates a filter expression as follows.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathFlatten flatten, com.fasterxml.jackson.databind.JsonNode input)` Flattens out the elements of the given expression into a single list.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathFunction function, com.fasterxml.jackson.databind.JsonNode input)` Evaluates function expression in applicative order.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathIdentity jmesPathIdentity, com.fasterxml.jackson.databind.JsonNode input)` Returns the input node itself
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathLiteral literal, com.fasterxml.jackson.databind.JsonNode input)` Retrieves the literal value
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathMultiSelectList multiSelectList, com.fasterxml.jackson.databind.JsonNode input)` Each expression in the multiselect list will be evaluated against the JSON document.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathNotExpression notExpression, com.fasterxml.jackson.databind.JsonNode input)` Not-expression negates the result of an expression.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathProjection jmesPathProjection, com.fasterxml.jackson.databind.JsonNode input)` Evaluates a list projection expression in two steps.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathSubExpression subExpression, com.fasterxml.jackson.databind.JsonNode input)` Evaluates a subexpression by evaluating the expression on the left with the original JSON document and then evaluating the expression on the right with the result of the left expression evaluation.
`com.fasterxml.jackson.databind.JsonNode` `visit(JmesPathValueProjection valueProjection, com.fasterxml.jackson.databind.JsonNode input)` Evaluates the object projection expression.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JmesPathEvaluationVisitor

    public JmesPathEvaluationVisitor()

### Method Detail

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathSubExpression subExpression,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Evaluates a subexpression by evaluating the expression on the left with the original JSON document and then evaluating the expression on the right with the result of the left expression evaluation.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `subExpression` - JmesPath subexpression type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the subexpression evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathField fieldNode,
                                                         com.fasterxml.jackson.databind.JsonNode input)

Retrieves the value of the field node

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `fieldNode` - JmesPath field type
  `input` - Input json node whose value is retrieved
Returns:
  Value of the input json node

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathProjection jmesPathProjection,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Evaluates a list projection expression in two steps. The left hand side (LHS) creates a JSON array of initial values. The right hand side (RHS) of a projection is the expression to project for each element in the JSON array created by the left hand side.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `jmesPathProjection` - JmesPath list projection type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the projection evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathFlatten flatten,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Flattens out the elements of the given expression into a single list. It's evaluated as follows. Create an empty result list. Iterate over the elements of the current result. If the current element is not a list, add to the end of the result list. If the current element is a list, add each element of the current element to the end of the result list. The result list is now the new current result.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `flatten` - JmesPath flatten type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the flatten evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathIdentity jmesPathIdentity,
                                                         com.fasterxml.jackson.databind.JsonNode input)

Returns the input node itself

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `jmesPathIdentity` - JmesPath identity type
  `input` - Input json node
Returns:
  Input node

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathValueProjection valueProjection,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Evaluates the object projection expression. This will create a list of the values of the JSON object(lhs), and project the right hand side of the projection onto the list of values.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `valueProjection` - JmesPath value projection type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the value projection evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathFunction function,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Evaluates function expression in applicative order. Each argument is an expression, each argument expression is evaluated before evaluating the function. The function is then called with the evaluated function arguments. The result of the function-expression is the result returned by the function call.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `function` - JmesPath function type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the function evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathLiteral literal,
                                                         com.fasterxml.jackson.databind.JsonNode input)

Retrieves the literal value

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `literal` - JmesPath literal type
  `input` - Input json node against which evaluation is done
Returns:
  Literal value

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathFilter filter,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Evaluates a filter expression as follows. For each element in an array evaluate the expression against the element. If the expression evaluates to a truth-like value, the item (in its entirety) is added to the result list. Otherwise it is excluded from the result list. A filter expression is only defined for a JSON array. Attempting to evaluate a filter expression against any other type will return null.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `filter` - JmesPath filter type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the filter expression evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(Comparator op,
                                                         com.fasterxml.jackson.databind.JsonNode input)

Evaluate the expressions as per the given comparison operator.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `op` - JmesPath comparison operator type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the comparison

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathNotExpression notExpression,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Not-expression negates the result of an expression. If the expression results in a truth-like value, a not-expression will change this value to false. If the expression results in a false-like value, a not-expression will change this value to true.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `notExpression` - JmesPath not-expression type
  `input` - Input json node against which evaluation is done
Returns:
  Negation of the evaluated expression
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathAndExpression andExpression,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

And expression will evaluate to either the left expression or the right expression. If the expression on the left hand side is a truth-like value, then the value on the right hand side is returned. Otherwise the result of the expression on the left hand side is returned.

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `andExpression` - JmesPath and-expression type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the and-expression evaluation
Throws:
  `InvalidTypeException`

#### visit

    public com.fasterxml.jackson.databind.JsonNode visit(JmesPathMultiSelectList multiSelectList,
                                                         com.fasterxml.jackson.databind.JsonNode input)
                                                  throws InvalidTypeException

Each expression in the multiselect list will be evaluated against the JSON document. Each returned element will be the result of evaluating the expression. A multi-select-list with N expressions will result in a list of length N. Given a multiselect expression [expr-1,expr-2,...,expr-n], the evaluated expression will return [evaluate(expr-1), evaluate(expr-2), ...,evaluate(expr-n)].

Specified by:
  `visit` in interface `JmesPathVisitor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>`
Parameters:
  `multiSelectList` - JmesPath multiselect list type
  `input` - Input json node against which evaluation is done
Returns:
  Result of the multiselect list evaluation
Throws:
  `InvalidTypeException`