@Test public void testArrayExpression() throws IOException { Optional<ASTExpression> a = parser.parse_StringExpression("a"); Optional<ASTExpression> b = parser.parse_StringExpression("b"); assertFalse(parser.hasErrors()); assertTrue(a.isPresent()); assertTrue(b.isPresent()); ASTArrayExpression result = JavaClassExpressionsMill.arrayExpressionBuilder() .setExpression(a.get()) .setIndexExpression(b.get()) .build(); String output = prettyPrinter.prettyprint(result); assertEquals("a[b]", output); }
public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); }
JavaClassExpressionsPrettyPrinter extends CommonExpressionsPrettyPrinter implements JavaClassExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } }
JavaClassExpressionsPrettyPrinter extends CommonExpressionsPrettyPrinter implements JavaClassExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } JavaClassExpressionsPrettyPrinter(IndentPrinter printer); }
JavaClassExpressionsPrettyPrinter extends CommonExpressionsPrettyPrinter implements JavaClassExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } JavaClassExpressionsPrettyPrinter(IndentPrinter printer); @Override void visit(ASTPrimarySuperExpression node); @Override void handle(ASTSuperSuffix node); @Override void handle(ASTSuperExpression node); @Override void handle(ASTClassExpression node); @Override void handle(ASTTypeCastExpression node); @Override void handle(ASTGenericInvocationSuffix node); @Override void handle(ASTGenericInvocationExpression node); @Override void handle(ASTPrimaryGenericInvocationExpression node); @Override void handle(ASTInstanceofExpression node); @Override void handle(ASTThisExpression node); @Override void handle(ASTArrayExpression node); @Override void visit(ASTPrimaryThisExpression node); @Override void handle(ASTArrayCreator a); @Override void handle(ASTArrayDimensionByExpression a); @Override void handle(ASTCreatorExpression a); IndentPrinter getPrinter(); String prettyprint(ASTExpression node); String prettyprint(ASTGenericInvocationSuffix node); String prettyprint(ASTSuperSuffix node); @Override void setRealThis(JavaClassExpressionsVisitor realThis); @Override JavaClassExpressionsVisitor getRealThis(); }
JavaClassExpressionsPrettyPrinter extends CommonExpressionsPrettyPrinter implements JavaClassExpressionsVisitor { public String prettyprint(ASTExpression node) { getPrinter().clearBuffer(); node.accept(getRealThis()); return getPrinter().getContent(); } JavaClassExpressionsPrettyPrinter(IndentPrinter printer); @Override void visit(ASTPrimarySuperExpression node); @Override void handle(ASTSuperSuffix node); @Override void handle(ASTSuperExpression node); @Override void handle(ASTClassExpression node); @Override void handle(ASTTypeCastExpression node); @Override void handle(ASTGenericInvocationSuffix node); @Override void handle(ASTGenericInvocationExpression node); @Override void handle(ASTPrimaryGenericInvocationExpression node); @Override void handle(ASTInstanceofExpression node); @Override void handle(ASTThisExpression node); @Override void handle(ASTArrayExpression node); @Override void visit(ASTPrimaryThisExpression node); @Override void handle(ASTArrayCreator a); @Override void handle(ASTArrayDimensionByExpression a); @Override void handle(ASTCreatorExpression a); IndentPrinter getPrinter(); String prettyprint(ASTExpression node); String prettyprint(ASTGenericInvocationSuffix node); String prettyprint(ASTSuperSuffix node); @Override void setRealThis(JavaClassExpressionsVisitor realThis); @Override JavaClassExpressionsVisitor getRealThis();  }