public void deDioxygenizeCommentBefore() { String comment = getCommentBefore(); if (comment != null) { comment = comment.replaceAll("\n\\s*\\* ", "\n"); } setCommentBefore(comment); } public void addToCommentBefore(String... s) {
public void addToCommentBefore(List<String> s) { String b = getCommentBefore(); List<String> ss = new ArrayList<String>(); if (b != null && (b = cleanComment(b)).length() > 0) ss.add(b); for (String a : s) if (a != null && (a = cleanComment(a)).length() > 0) ss.add(a); //s); //if (b != null && b.trim().length() > 0) // ss.add(0, b); setCommentBefore(ss.isEmpty() ? null : StringUtils.implode(ss, "\n")); } public void moveAllCommentsBefore() {
public Printer formatComments(Element e, boolean mergeCommentsAfter, boolean allowLineComments, boolean skipLineAfter, String... otherComments) { String cb = e.getCommentBefore(), ca = e.getCommentAfter(); if (cb != null || ca != null || otherComments.length > 0) { append(formatComments(indent, cb, ca, mergeCommentsAfter, allowLineComments, skipLineAfter, otherComments)); } return this; }
public Element importDetails(Element from, boolean move) { if (from == null) return this; if (from.getElementFile() != null) setElementFile(from.getElementFile()); if (from.getElementLine() >= 0) setElementLine(from.getElementLine()); if (from.getCommentBefore() != null) addToCommentBefore(from.getCommentBefore()); if (from.getCommentAfter() != null) setCommentAfter(from.getCommentAfter()); if (move) from.stripDetails(); return this; } protected <T> List<T> unmodifiableList(List<T> list) {
protected void outputNSString(String name, String value, DeclarationsHolder out, Signatures signatures, Element... elementsToTakeCommentsFrom) { if (!signatures.addVariable(name)) { return; } TypeRef tr = typeRef(String.class); VariablesDeclaration vd = new VariablesDeclaration(tr, new DirectDeclarator(name, expr(value))); if (!result.config.noComments) { for (Element e : elementsToTakeCommentsFrom) { vd.addToCommentBefore(e.getCommentBefore()); vd.addToCommentBefore(e.getCommentAfter()); } } vd.addModifiers(ModifierType.Public); out.addDeclaration(vd); } static Map<Class<?>, Pair<List<Pair<Function, String>>, Set<String>>> cachedForcedMethodsAndTheirSignatures;
protected void outputNSString(String name, String value, DeclarationsHolder out, Signatures signatures, Element... elementsToTakeCommentsFrom) { if (!signatures.addVariable(name)) { return; } TypeRef tr = typeRef(String.class); VariablesDeclaration vd = new VariablesDeclaration(tr, new DirectDeclarator(name, expr(value))); if (!result.config.noComments) { for (Element e : elementsToTakeCommentsFrom) { vd.addToCommentBefore(e.getCommentBefore()); vd.addToCommentBefore(e.getCommentAfter()); } } vd.addModifiers(ModifierType.Public); out.addDeclaration(vd); } static Map<Class<?>, Pair<List<Pair<Function, String>>, Set<String>>> cachedForcedMethodsAndTheirSignatures;
callbackStruct.addToCommentBefore(comel.getCommentBefore(), comel.getCommentAfter(), getFileCommentContent(comel));
callbackStruct.addToCommentBefore(comel.getCommentBefore(), comel.getCommentAfter(), getFileCommentContent(comel));