@Test public void primitivesTest(){ Class foo = boolean.class; MCBasicTypesPrettyPrinter prettyprinter = new MCBasicTypesPrettyPrinter(new IndentPrinter()); String[] primitives = new String[]{"boolean", "byte", "char", "short", "int", "long", "float", "double"}; try { for (String primitive : primitives) { prettyprinter.getPrinter().clearBuffer(); MCBasicTypesTestParser mcBasicTypesParser = new MCBasicTypesTestParser(); Optional<? extends ASTMCType> type = mcBasicTypesParser.parse_StringMCPrimitiveType(primitive); type.get().accept(prettyprinter); assertTrue(type.isPresent()); assertEquals(primitive,prettyprinter.getPrinter().getContent()); assertTrue(type.get() instanceof ASTMCPrimitiveType); } } catch (IOException e) { e.printStackTrace(); } }
public IndentPrinter getPrinter() { return printer; }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public IndentPrinter getPrinter() { return printer; } }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public IndentPrinter getPrinter() { return printer; } MCBasicTypesPrettyPrinter(IndentPrinter printer); }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public IndentPrinter getPrinter() { return printer; } MCBasicTypesPrettyPrinter(IndentPrinter printer); IndentPrinter getPrinter(); void setPrinter(IndentPrinter printer); @Override void handle(ASTMCQualifiedName a); @Override void handle(ASTMCVoidType a); @Override void handle(ASTMCPrimitiveType a); @Override void handle(ASTMCImportStatement a); String prettyprint(ASTMCBasicTypesNode a); void setRealThis(MCBasicTypesVisitor realThis); @Override MCBasicTypesVisitor getRealThis(); }
MCBasicTypesPrettyPrinter implements MCBasicTypesVisitor { public IndentPrinter getPrinter() { return printer; } MCBasicTypesPrettyPrinter(IndentPrinter printer); IndentPrinter getPrinter(); void setPrinter(IndentPrinter printer); @Override void handle(ASTMCQualifiedName a); @Override void handle(ASTMCVoidType a); @Override void handle(ASTMCPrimitiveType a); @Override void handle(ASTMCImportStatement a); String prettyprint(ASTMCBasicTypesNode a); void setRealThis(MCBasicTypesVisitor realThis); @Override MCBasicTypesVisitor getRealThis();  }