public void visit(ClassOrInterfaceDeclaration n, String objectType) { try { Comment comment = n.getComment().get(); javadoc.append(String.format("{panel}%s{panel}\n", formatJavadoc(comment.getContent()))); } catch (NoSuchElementException e) { javadoc.append(String.format("{panel}%s de la classe %s{panel}\n", objectType, n.getNameAsString())); } } }
@Override public void visit(ClassOrInterfaceDeclaration classOrInterface, Void arg) { className = calculateClassName(classOrInterface); classOrInterface.getComment() .filter(Comment::isJavadocComment) .map(this::toJavaDoc) .ifPresent(this::recordClassComment); super.visit(classOrInterface, arg); }
@Override public void visit(ClassOrInterfaceDeclaration classOrInterface, Void arg) { className = calculateClassName(classOrInterface); classOrInterface.getComment() .filter(Comment::isJavadocComment) .map(this::toJavaDoc) .ifPresent(this::recordClassComment); super.visit(classOrInterface, arg); }
public static ClassOrInterfaceDeclaration mergeType(ClassOrInterfaceDeclaration one, ClassOrInterfaceDeclaration two) { if (isAllNull(one, two)) return null; ClassOrInterfaceDeclaration coid = null; if (isAllNotNull(one, two)) { coid = new ClassOrInterfaceDeclaration(); coid.setName(one.getName()); coid.setJavaDoc(mergeSelective(one.getJavaDoc(), two.getJavaDoc())); coid.setComment(mergeSelective(one.getComment(), two.getComment())); coid.setAnnotations(mergeListNoDuplicate(one.getAnnotations(), two.getAnnotations())); coid.setModifiers(mergeModifiers(one.getModifiers(), two.getModifiers())); coid.setExtends(mergeListNoDuplicate(one.getExtends(), two.getExtends())); coid.setImplements(mergeListNoDuplicate(one.getImplements(), two.getImplements())); coid.setTypeParameters(mergeSelective(one.getTypeParameters(), two.getTypeParameters())); coid.setInterface(one.isInterface()); coid.setMembers(mergeBodies(one.getMembers(), two.getMembers())); LOG.info("merge ClassOrInterfaceDeclaration --> {}", coid.getName()); } else { coid = findFirstNotNull(one, two); LOG.info("add ClassOrInterfaceDeclaration --> {}", coid.getName()); } return coid; }