Example usage for org.eclipse.jdt.core.dom LineComment accept

List of usage examples for org.eclipse.jdt.core.dom LineComment accept

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom LineComment accept.

Prototype

public final void accept(ASTVisitor visitor) 

Source Link

Document

Accepts the given visitor on a visit of the current node.

Usage

From source file:org.autorefactor.refactoring.rules.CommentsRefactoring.java

License:Open Source License

@Override
public boolean visit(CompilationUnit node) {
    this.astRoot = node;
    for (Comment comment : getCommentList(astRoot)) {
        comments.add(Pair.of(new SourceLocation(comment), comment));
    }/*from   w  ww  .j a  va2  s . c  om*/

    for (Comment comment : getCommentList(astRoot)) {
        if (comment.isBlockComment()) {
            final BlockComment bc = (BlockComment) comment;
            bc.accept(this);
        } else if (comment.isLineComment()) {
            final LineComment lc = (LineComment) comment;
            lc.accept(this);
        } else if (comment.isDocComment()) {
            final Javadoc jc = (Javadoc) comment;
            jc.accept(this);
        } else {
            throw new NotImplementedException(comment);
        }
    }
    return VISIT_SUBTREE;
}