/** * Analyzes the given source code and populates the constraint. * * @param source the source code of the constraint */ public void analyzeSource(String source) { // First analyze the expressions contained in the source: ExpressionAnalyzer expressionAnalyzer = new ExpressionAnalyzer(); List<Expression> expressions = expressionAnalyzer.analyzeExpressions(source); // Transform all the expressions replacing methods and fields with parameters and attributes: expressions = expressions.stream().map(this::transform).collect(Collectors.toList()); // Add the resulting expressions to the constraint: constraint.addExpressions(expressions); }