/** * Generates the code for a new JmesPathField. * * @param fieldNode JmesPath field type * @param aVoid void * @return String that represents a call to * the new fieldNode */ @Override public String visit(final JmesPathField fieldNode, final Void aVoid) { return "new JmesPathField( \"" + fieldNode.getValue() + "\")"; }
private static JmesPathExpression jsonToField(JsonNode jsonNode) { return new JmesPathField(jsonNode.get("value").asText()); }
/** * Retrieves the value of the field node * * @param fieldNode JmesPath field type * @param input Input json node whose value is * retrieved * @return Value of the input json node */ @Override public JsonNode visit(JmesPathField fieldNode, JsonNode input) { if (input.isObject()) { //TODO : CamelCase will need to change at some point return input.get(CamelCaseUtils.toCamelCase(fieldNode.getValue())); } return NullNode.getInstance(); }
private static JmesPathExpression jsonToField(JsonNode jsonNode) { return new JmesPathField(jsonNode.get("value").asText()); }
/** * Generates the code for a new JmesPathField. * * @param fieldNode JmesPath field type * @param aVoid void * @return String that represents a call to * the new fieldNode */ @Override public String visit(final JmesPathField fieldNode, final Void aVoid) { return "new JmesPathField( \"" + fieldNode.getValue() + "\")"; }
/** * Retrieves the value of the field node * * @param fieldNode JmesPath field type * @param input Input json node whose value is * retrieved * @return Value of the input json node */ @Override public JsonNode visit(JmesPathField fieldNode, JsonNode input) { if (input.isObject()) { //TODO : CamelCase will need to change at some point return input.get(CamelCaseUtils.toCamelCase(fieldNode.getValue())); } return NullNode.getInstance(); }
/** * Retrieves the value of the field node * * @param fieldNode JmesPath field type * @param input Input json node whose value is * retrieved * @return Value of the input json node */ @Override public JsonNode visit(JmesPathField fieldNode, JsonNode input) { if (input.isObject()) { //TODO : CamelCase will need to change at some point return input.get(CamelCaseUtils.toCamelCase(fieldNode.getValue())); } return NullNode.getInstance(); }