/** * Generates the code for a new JmesPathAndExpression. * * @param andExpression JmesPath and-expression type * @param aVoid void * @return String that represents a call to * the new and-expression * @throws InvalidTypeException */ @Override public String visit(final JmesPathAndExpression andExpression, final Void aVoid) throws InvalidTypeException { return "new JmesPathAndExpression( " + andExpression.getLhsExpr() .accept(this, aVoid) + ", " + andExpression.getRhsExpr() .accept(this, aVoid) + " )"; }
/** * 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. * * @param andExpression JmesPath and-expression type * @param input Input json node against which evaluation is done * @return Result of the and-expression evaluation * @throws InvalidTypeException */ @Override public JsonNode visit(JmesPathAndExpression andExpression, JsonNode input) throws InvalidTypeException { JsonNode lhsNode = andExpression.getLhsExpr().accept(this, input); JsonNode rhsNode = andExpression.getRhsExpr().accept(this, input); if (lhsNode == BooleanNode.TRUE) { return rhsNode; } else { return lhsNode; } }
/** * Generates the code for a new JmesPathAndExpression. * * @param andExpression JmesPath and-expression type * @param aVoid void * @return String that represents a call to * the new and-expression * @throws InvalidTypeException */ @Override public String visit(final JmesPathAndExpression andExpression, final Void aVoid) throws InvalidTypeException { return "new JmesPathAndExpression( " + andExpression.getLhsExpr() .accept(this, aVoid) + ", " + andExpression.getRhsExpr() .accept(this, aVoid) + " )"; }
/** * 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. * * @param andExpression JmesPath and-expression type * @param input Input json node against which evaluation is done * @return Result of the and-expression evaluation * @throws InvalidTypeException */ @Override public JsonNode visit(JmesPathAndExpression andExpression, JsonNode input) throws InvalidTypeException { JsonNode lhsNode = andExpression.getLhsExpr().accept(this, input); JsonNode rhsNode = andExpression.getRhsExpr().accept(this, input); if (lhsNode == BooleanNode.TRUE) { return rhsNode; } else { return lhsNode; } }
/** * 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. * * @param andExpression JmesPath and-expression type * @param input Input json node against which evaluation is done * @return Result of the and-expression evaluation * @throws InvalidTypeException */ @Override public JsonNode visit(JmesPathAndExpression andExpression, JsonNode input) throws InvalidTypeException { JsonNode lhsNode = andExpression.getLhsExpr().accept(this, input); JsonNode rhsNode = andExpression.getRhsExpr().accept(this, input); if (lhsNode == BooleanNode.TRUE) { return rhsNode; } else { return lhsNode; } }