public EmptyDeclaration skipDeclaration(Element e, String... preMessages) { if (result.config.limitComments) { return null; } List<String> mess = new ArrayList<String>(); if (preMessages != null) { mess.addAll(Arrays.asList(preMessages)); } mess.addAll(Arrays.asList("SKIPPED:", new Printer(null).formatComments(e, true, true, false).toString(), getFileCommentContent(e), e.toString().replace("*/", "* /"))); return new EmptyDeclaration(mess.toArray(new String[0])); }
public void visitEnumItem(EnumItem e) { formatComments(e, false, true, true); append(e.getName()); if (!e.getArguments().isEmpty()) { if (e.getType() == Type.C) { append(" = ", e.getArguments().get(0)); } else { append("("); implode(e.getArguments(), ", "); append(")"); } } if (e.getBody() != null) { append(" {\n\t", indent); indent(); implode(e.getBody().getDeclarations(), "\n" + indent); deindent(); append("\n", indent, "}"); } space(e.getCommentAfter() != null).append(e.getCommentAfter()); }
public void visitExpressionsBlock(ExpressionsBlock e) { expressionPre(e); append("{ "); implode(e.getExpressions(), ", "); append(" }"); expressionPost(e); }
while (result.next()) { Printer printer = new Printer(); printer.setPrinterid(result.getString("printerid")); printer.setNaam(result.getString("printernaam")); printer.setAantalKl(result.getInt("aantalkleur")); printer.setAantalZw(result.getInt("aantalzwart")); printers.add(printer); // Adds the printer to the arraylist. }
public void visitNullExpression(NullExpression e) { expressionPre(e); append("null"); expressionPost(e); }
public void visitVariablesDeclaration(VariablesDeclaration e) { formatComments(e, false, true, true); if (!e.getAnnotations().isEmpty()) { implode(e.getAnnotations(), "\n" + indent).append("\n", indent); } modifiersStringPrefix(e); valueTypeAndStorageSuffix(e); if (!(e.getParentElement() instanceof Catch)) { append(";"); } if (e.getCommentAfter() != null) { space().append(e.getCommentAfter()); } }
Printer pt = new Printer(); for (int i = 0, n = sis.size(); i < n; i++) { if (i != 0) { pt.append("."); pt.append(sis.get(i)); String str = pt.toString(); if (importedClassesStrings.contains(str)) { for (int j = i; j-- != 0;) { super.visitQualifiedIdentifier(e);
public class Entry { public static void main(String[] args){ String[] wordArray = readWordArray() Printer p = new Printer(); p.printForwards(wordArray); p.printBackwards(wordArray); p.printEveryOther(wordArray); } private static String[] readWordArray() { Dialogue d = new Dialogue(); return d.read(new String[10]); } }
public void visitTypeDef(TypeDef e) { formatComments(e, false, true, true); modifiersStringPrefix(e); append("typedef "); valueTypeAndStorageSuffix(e); append(";"); if (e.getCommentAfter() != null) { append(" ", e.getCommentAfter().trim()); } }
Printer epson = new Printer ("Epson579", "All In One", 2, 50.99); System.out.println("Item Number: " + epson.getItemNumber()); System.out.println("Product Name: " + epson.getProductName());
append("<no function type>"); return; formatComments(e, false, true, true); if (!e.getAnnotations().isEmpty()) { implode(e.getAnnotations(), "\n" + indent).append("\n", indent); implode(modifiers, " "); space(!modifiers.isEmpty()); append(e.getBody() == null ? ";" : e.getBody()); break; case CFunction: case JavaMethod: if (name != null && name.equals("operator") && e.getType() == Function.Type.CppMethod) { append(name); space(); implode(modifiers, " "); space(!modifiers.isEmpty()); append(valueType); } else { implode(modifiers, " "); space(!modifiers.isEmpty()); append(valueType); space(valueType != null); append(name); append("(").implode(e.getArgs(), ", ").append(")");
public void visitAssignmentOp(AssignmentOp e) { expressionPre(e); append(e.getTarget()).space().append(AssignmentOp.assignOpsRev.get(e.getOperator())).space().append(e.getValue()); expressionPost(e); }
public void visitSimpleTypeRef(SimpleTypeRef e) { formatComments(e, true, false, false).modifiersStringPrefix(e).append(e.getName()); }
public void visitFunctionSignature(FunctionSignature e) { if (e.getFunction() == null) { return; } assert e.getFunction().getBody() == null; modifiersStringPrefix(e); append(e.getFunction().getValueType()).space(e.getFunction().getValueType() != null); if (e.getParentElement() instanceof TypeRef.Pointer) { append("("); modifiersStringPrefix(e.getFunction()); switch (e.getType()) { case CFunction: append("*"); break; case ObjCBlock: append("^"); break; } append(e.getFunction().getName()); append(")"); } else { append(e.getFunction().getName()); } append("("); implode(e.getFunction().getArgs(), ", "); append(")"); append(e.getModifiers().isEmpty() ? "" : " "); implode(e.getModifiers(), " "); }