/** * Writes a statement. */ public void writeStatement(CtStatement statement) { try (Writable _context = prettyPrinter.getContext().modify().setStatement(statement)) { prettyPrinter.scan(statement); } }
/** * Writes actual type arguments in a {@link CtActualTypeContainer} element. * * @param ctGenericElementReference * Reference with actual type arguments. */ public void writeActualTypeArguments(CtActualTypeContainer ctGenericElementReference) { final Collection<CtTypeReference<?>> arguments = ctGenericElementReference.getActualTypeArguments(); if (arguments != null && !arguments.isEmpty()) { printList(arguments.stream().filter(a -> !a.isImplicit())::iterator, null, false, "<", false, false, ",", true, false, ">", argument -> { if (prettyPrinter.getContext().forceWildcardGenerics()) { printer.writeSeparator("?"); } else { prettyPrinter.scan(argument); } }); } }
obj -> writeAnnotationElement(factory, obj)); } else if (value instanceof Enum) { try (Writable c = prettyPrinter.getContext().modify().ignoreGenerics(true)) { prettyPrinter.scan(factory.Type().createReference(((Enum<?>) value).getDeclaringClass()));