Search in sources :

Example 16 with JavadocComment

use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(EnumDeclaration _n, Object _arg) {
    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<ClassOrInterfaceType> implementsList = visit(_n.getImplements(), _arg);
    List<EnumConstantDeclaration> entries = visit(_n.getEntries(), _arg);
    List<BodyDeclaration> members = visit(_n.getMembers(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);
    EnumDeclaration r = new EnumDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getModifiers(), annotations, _n.getName(), implementsList, entries, members);
    r.setComment(comment);
    return r;
}
Also used : EnumConstantDeclaration(com.github.javaparser.ast.body.EnumConstantDeclaration) JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BodyDeclaration(com.github.javaparser.ast.body.BodyDeclaration) EnumDeclaration(com.github.javaparser.ast.body.EnumDeclaration)

Example 17 with JavadocComment

use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(ConstructorDeclaration _n, Object _arg) {
    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
    List<Parameter> parameters = visit(_n.getParameters(), _arg);
    List<NameExpr> throws_ = visit(_n.getThrows(), _arg);
    BlockStmt block = cloneNodes(_n.getBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);
    ConstructorDeclaration r = new ConstructorDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block);
    r.setComment(comment);
    return r;
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) TypeParameter(com.github.javaparser.ast.TypeParameter) MultiTypeParameter(com.github.javaparser.ast.body.MultiTypeParameter) JavadocComment(com.github.javaparser.ast.comments.JavadocComment) ConstructorDeclaration(com.github.javaparser.ast.body.ConstructorDeclaration) Parameter(com.github.javaparser.ast.body.Parameter) TypeParameter(com.github.javaparser.ast.TypeParameter) MultiTypeParameter(com.github.javaparser.ast.body.MultiTypeParameter)

Example 18 with JavadocComment

use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(JavadocComment _n, Object _arg) {
    Comment comment = cloneNodes(_n.getComment(), _arg);
    JavadocComment r = new JavadocComment(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getContent());
    r.setComment(comment);
    return r;
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) JavadocComment(com.github.javaparser.ast.comments.JavadocComment)

Example 19 with JavadocComment

use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) {
    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
    List<ClassOrInterfaceType> extendsList = visit(_n.getExtends(), _arg);
    List<ClassOrInterfaceType> implementsList = visit(_n.getImplements(), _arg);
    List<BodyDeclaration> members = visit(_n.getMembers(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);
    ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members);
    r.setComment(comment);
    return r;
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) TypeParameter(com.github.javaparser.ast.TypeParameter) MultiTypeParameter(com.github.javaparser.ast.body.MultiTypeParameter) JavadocComment(com.github.javaparser.ast.comments.JavadocComment) ClassOrInterfaceDeclaration(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration) BodyDeclaration(com.github.javaparser.ast.body.BodyDeclaration)

Example 20 with JavadocComment

use of com.github.javaparser.ast.comments.JavadocComment in project javaparser by javaparser.

the class CloneVisitor method visit.

@Override
public Node visit(FieldDeclaration _n, Object _arg) {
    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    Type type_ = cloneNodes(_n.getType(), _arg);
    List<VariableDeclarator> variables = visit(_n.getVariables(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);
    FieldDeclaration r = new FieldDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getModifiers(), annotations, type_, variables);
    r.setComment(comment);
    return r;
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) BlockComment(com.github.javaparser.ast.comments.BlockComment) LineComment(com.github.javaparser.ast.comments.LineComment) Comment(com.github.javaparser.ast.comments.Comment) JavadocComment(com.github.javaparser.ast.comments.JavadocComment) FieldDeclaration(com.github.javaparser.ast.body.FieldDeclaration) VariableDeclarator(com.github.javaparser.ast.body.VariableDeclarator)

Aggregations

JavadocComment (com.github.javaparser.ast.comments.JavadocComment)25 Comment (com.github.javaparser.ast.comments.Comment)16 BlockComment (com.github.javaparser.ast.comments.BlockComment)14 LineComment (com.github.javaparser.ast.comments.LineComment)14 Test (org.junit.Test)7 BodyDeclaration (com.github.javaparser.ast.body.BodyDeclaration)4 ClassOrInterfaceDeclaration (com.github.javaparser.ast.body.ClassOrInterfaceDeclaration)4 TypeParameter (com.github.javaparser.ast.TypeParameter)3 MultiTypeParameter (com.github.javaparser.ast.body.MultiTypeParameter)3 AnnotationDeclaration (com.github.javaparser.ast.body.AnnotationDeclaration)2 EnumConstantDeclaration (com.github.javaparser.ast.body.EnumConstantDeclaration)2 MethodDeclaration (com.github.javaparser.ast.body.MethodDeclaration)2 Parameter (com.github.javaparser.ast.body.Parameter)2 CsmElement (com.github.javaparser.printer.concretesyntaxmodel.CsmElement)2 CsmToken (com.github.javaparser.printer.concretesyntaxmodel.CsmToken)2 Javadoc (act.apidoc.javadoc.Javadoc)1 ParseProblemException (com.github.javaparser.ParseProblemException)1 com.github.javaparser.ast (com.github.javaparser.ast)1 CompilationUnit (com.github.javaparser.ast.CompilationUnit)1 Modifier (com.github.javaparser.ast.Modifier)1