use of spoon.reflect.code.CtCodeElement in project spoon by INRIA.
the class DefaultJavaPrettyPrinter method printConstructorCall.
private <T> void printConstructorCall(CtConstructorCall<T> ctConstructorCall) {
try (Writable _context = context.modify()) {
if (ctConstructorCall.getTarget() != null) {
scan(ctConstructorCall.getTarget());
printer.writeSeparator(".");
_context.ignoreEnclosingClass(true);
}
if (hasDeclaringTypeWithGenerics(ctConstructorCall.getType())) {
_context.ignoreEnclosingClass(true);
}
printer.writeKeyword("new").writeSpace();
if (ctConstructorCall.getActualTypeArguments().size() > 0) {
elementPrinterHelper.writeActualTypeArguments(ctConstructorCall);
}
scan(ctConstructorCall.getType());
}
try (ListPrinter lp = elementPrinterHelper.createListPrinter(false, "(", false, false, ",", true, false, ")")) {
for (CtCodeElement exp : ctConstructorCall.getArguments()) {
lp.printSeparatorIfAppropriate();
scan(exp);
}
}
}
Aggregations