@Test void evaluateList() { List<Object> input = Collections.singletonList("value"); List<?> evaluated = new ExpressionTransform(parserContext, parser, Function.identity()) .transformList( input, new StandardEvaluationContext(), new ExpressionEvaluationSummary(), Collections.emptyMap()); assertThat(evaluated).isEqualTo(input); }
public List transformList( List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) { List<Object> result = new ArrayList<>(); for (Object obj : source) { if (obj instanceof Map) { result.add(transformMap((Map<String, Object>) obj, evaluationContext, summary)); } else if (obj instanceof List) { result.add(transformList((List) obj, evaluationContext, summary, additionalContext)); } else { result.add(transform(obj, evaluationContext, summary, additionalContext)); } } return result; }
ExpressionTransform { public List transformList( List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) { List<Object> result = new ArrayList<>(); for (Object obj : source) { if (obj instanceof Map) { result.add(transformMap((Map<String, Object>) obj, evaluationContext, summary)); } else if (obj instanceof List) { result.add(transformList((List) obj, evaluationContext, summary, additionalContext)); } else { result.add(transform(obj, evaluationContext, summary, additionalContext)); } } return result; } }
ExpressionTransform { public List transformList( List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) { List<Object> result = new ArrayList<>(); for (Object obj : source) { if (obj instanceof Map) { result.add(transformMap((Map<String, Object>) obj, evaluationContext, summary)); } else if (obj instanceof List) { result.add(transformList((List) obj, evaluationContext, summary, additionalContext)); } else { result.add(transform(obj, evaluationContext, summary, additionalContext)); } } return result; } ExpressionTransform(
      ParserContext parserContext,
      ExpressionParser parser,
      Function<String, String> stringExpressionPreprocessor,
      Class<?>... typesToStringify); }
ExpressionTransform { public List transformList( List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) { List<Object> result = new ArrayList<>(); for (Object obj : source) { if (obj instanceof Map) { result.add(transformMap((Map<String, Object>) obj, evaluationContext, summary)); } else if (obj instanceof List) { result.add(transformList((List) obj, evaluationContext, summary, additionalContext)); } else { result.add(transform(obj, evaluationContext, summary, additionalContext)); } } return result; } ExpressionTransform(
      ParserContext parserContext,
      ExpressionParser parser,
      Function<String, String> stringExpressionPreprocessor,
      Class<?>... typesToStringify); static String escapeSimpleExpression(String expression); Map<String, Object> transformMap(
      Map<String, Object> source,
      EvaluationContext evaluationContext,
      ExpressionEvaluationSummary summary); List transformList(
      List source,
      EvaluationContext evaluationContext,
      ExpressionEvaluationSummary summary,
      Map<String, Object> additionalContext); String transformString(
      String source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary); }
ExpressionTransform { public List transformList( List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) { List<Object> result = new ArrayList<>(); for (Object obj : source) { if (obj instanceof Map) { result.add(transformMap((Map<String, Object>) obj, evaluationContext, summary)); } else if (obj instanceof List) { result.add(transformList((List) obj, evaluationContext, summary, additionalContext)); } else { result.add(transform(obj, evaluationContext, summary, additionalContext)); } } return result; } ExpressionTransform(
      ParserContext parserContext,
      ExpressionParser parser,
      Function<String, String> stringExpressionPreprocessor,
      Class<?>... typesToStringify); static String escapeSimpleExpression(String expression); Map<String, Object> transformMap(
      Map<String, Object> source,
      EvaluationContext evaluationContext,
      ExpressionEvaluationSummary summary); List transformList(
      List source,
      EvaluationContext evaluationContext,
      ExpressionEvaluationSummary summary,
      Map<String, Object> additionalContext); String transformString(
      String source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary);  }