use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.
the class CloneVisitor method visit.
@Override
public Node visit(EmptyTypeDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
EmptyTypeDeclaration r = new EmptyTypeDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn());
r.setComment(comment);
return r;
}
use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.
the class CloneVisitor method visit.
@Override
public Node visit(EnumConstantDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<Expression> args = visit(_n.getArgs(), _arg);
List<BodyDeclaration> classBody = visit(_n.getClassBody(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
EnumConstantDeclaration r = new EnumConstantDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), annotations, _n.getName(), args, classBody);
r.setComment(comment);
return r;
}
use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.
the class CloneVisitor method visit.
@Override
public Node visit(MethodDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
Type type_ = cloneNodes(_n.getType(), _arg);
List<Parameter> parameters = visit(_n.getParameters(), _arg);
List<NameExpr> throws_ = visit(_n.getThrows(), _arg);
BlockStmt block = cloneNodes(_n.getBody(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
MethodDeclaration r = new MethodDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getModifiers(), annotations, typeParameters, type_, _n.getName(), parameters, _n.getArrayCount(), throws_, block);
r.setComment(comment);
return r;
}
use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.
the class NodeTest method hasJavaDocCommentPositiveCaseWithSetComment.
@Test
public void hasJavaDocCommentPositiveCaseWithSetComment() {
ClassOrInterfaceDeclaration decl = new ClassOrInterfaceDeclaration(EnumSet.noneOf(Modifier.class), false, "Foo");
decl.setComment(new JavadocComment("A comment"));
assertEquals(true, decl.hasJavaDocComment());
}
use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.
the class JavadocTest method toCommentForEmptyJavadoc.
@Test
public void toCommentForEmptyJavadoc() {
Javadoc javadoc = new Javadoc(new JavadocDescription());
assertEquals(new JavadocComment("" + EOL + "\t\t "), javadoc.toComment("\t\t"));
}
Aggregations