Example usage for org.eclipse.jdt.core.dom BodyDeclaration getRoot

List of usage examples for org.eclipse.jdt.core.dom BodyDeclaration getRoot

Introduction

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

Prototype

public final ASTNode getRoot() 

Source Link

Document

Returns the root node at or above this node; returns this node if it is a root.

Usage

From source file:com.google.currysrc.api.process.ast.TypeLocator.java

License:Apache License

@Override
public boolean matches(BodyDeclaration node) {
    if (!(node instanceof AbstractTypeDeclaration)) {
        return false;
    }/*  w  ww . j  ava2 s.  com*/
    if (!packageMatcher.matches((CompilationUnit) node.getRoot())) {
        return false;
    }

    Iterable<String> reverseClassNames = Lists.reverse(classNameElements);
    Iterator<String> reverseClassNamesIterator = reverseClassNames.iterator();
    return matchNested(reverseClassNamesIterator, (AbstractTypeDeclaration) node);
}