com.android.tools.lint.client.api
Class JavaParser.ResolvedNode

java.lang.Object
  extended by com.android.tools.lint.client.api.JavaParser.ResolvedNode
Direct Known Subclasses:
JavaParser.ResolvedAnnotation, JavaParser.ResolvedClass, JavaParser.ResolvedField, JavaParser.ResolvedMethod, JavaParser.ResolvedPackage, JavaParser.ResolvedVariable
Enclosing class:
JavaParser

public abstract static class JavaParser.ResolvedNode
extends java.lang.Object

A resolved declaration from an AST Node reference


Constructor Summary
JavaParser.ResolvedNode()
           
 
Method Summary
 lombok.ast.Node findAstNode()
          Attempts to find the corresponding AST node, if possible.
 JavaParser.ResolvedAnnotation getAnnotation(java.lang.String type)
          Searches for the annotation of the given type on this node
abstract  java.lang.Iterable<JavaParser.ResolvedAnnotation> getAnnotations()
          Returns any annotations defined on this node
abstract  int getModifiers()
           
abstract  java.lang.String getName()
           
abstract  java.lang.String getSignature()
          Returns the signature of the resolved node
 boolean isInPackage(java.lang.String pkg, boolean includeSubPackages)
          Returns true if this element is in the given package (or optionally, in one of its sub packages)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaParser.ResolvedNode

public JavaParser.ResolvedNode()
Method Detail

getName

@NonNull
public abstract java.lang.String getName()

getSignature

public abstract java.lang.String getSignature()
Returns the signature of the resolved node


getModifiers

public abstract int getModifiers()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAnnotations

@NonNull
public abstract java.lang.Iterable<JavaParser.ResolvedAnnotation> getAnnotations()
Returns any annotations defined on this node


getAnnotation

@Nullable
public JavaParser.ResolvedAnnotation getAnnotation(@NonNull
                                                            java.lang.String type)
Searches for the annotation of the given type on this node

Parameters:
type - the fully qualified name of the annotation to check
Returns:
the annotation, or null if not found

isInPackage

public boolean isInPackage(@NonNull
                           java.lang.String pkg,
                           boolean includeSubPackages)
Returns true if this element is in the given package (or optionally, in one of its sub packages)

Parameters:
pkg - the package name
includeSubPackages - whether to include subpackages
Returns:
true if the element is in the given package

findAstNode

@Nullable
public lombok.ast.Node findAstNode()
Attempts to find the corresponding AST node, if possible. This won't work if for example the resolved node is from a binary (such as a compiled class in a .jar) or if the underlying parser doesn't support it.

Note that looking up the AST node can result in different instances for each lookup.

Returns:
an AST node, if possible.