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

java.lang.Object
  extended by com.android.tools.lint.client.api.JavaParser.ResolvedNode
      extended by com.android.tools.lint.client.api.JavaParser.ResolvedClass
Enclosing class:
JavaParser

public abstract static class JavaParser.ResolvedClass
extends JavaParser.ResolvedNode

A resolved class declaration (class, interface, enumeration or annotation)


Constructor Summary
JavaParser.ResolvedClass()
           
 
Method Summary
abstract  java.lang.Iterable<JavaParser.ResolvedMethod> getConstructors()
           
abstract  JavaParser.ResolvedClass getContainingClass()
           
abstract  JavaParser.ResolvedField getField(java.lang.String name, boolean includeInherited)
          Returns the named field defined in this class, or optionally inherited from a superclass
abstract  java.lang.Iterable<JavaParser.ResolvedField> getFields(boolean includeInherited)
          Returns the fields defined in this class, and optionally any fields declared in any superclasses as well
abstract  java.lang.Iterable<JavaParser.ResolvedClass> getInterfaces()
           
abstract  java.lang.Iterable<JavaParser.ResolvedMethod> getMethods(boolean includeInherited)
          Returns the methods defined in this class, and optionally any methods inherited from any superclasses as well
abstract  java.lang.Iterable<JavaParser.ResolvedMethod> getMethods(java.lang.String name, boolean includeInherited)
          Returns the methods of a given name defined in this class, and optionally any methods inherited from any superclasses as well
abstract  java.lang.String getName()
          Returns the fully qualified name of this class
abstract  JavaParser.ResolvedPackage getPackage()
          Returns the package containing this class
 java.lang.String getPackageName()
          Returns the package name of this class
abstract  java.lang.String getSimpleName()
          Returns the simple name of this class
abstract  JavaParser.ResolvedClass getSuperClass()
           
 JavaParser.TypeDescriptor getType()
           
abstract  boolean isImplementing(java.lang.String name, boolean strict)
          Determines whether this is implementing the given interface.
abstract  boolean isInheritingFrom(java.lang.String name, boolean strict)
          Determines whether this class extends or implements the class of the given name.
 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)
abstract  boolean isSubclassOf(java.lang.String name, boolean strict)
          Determines whether this class extends the given name.
abstract  boolean matches(java.lang.String name)
          Returns whether this class' fully qualified name matches the given name
 
Methods inherited from class com.android.tools.lint.client.api.JavaParser.ResolvedNode
findAstNode, getAnnotation, getAnnotations, getModifiers, getSignature, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaParser.ResolvedClass

public JavaParser.ResolvedClass()
Method Detail

getName

@NonNull
public abstract java.lang.String getName()
Returns the fully qualified name of this class

Specified by:
getName in class JavaParser.ResolvedNode

getSimpleName

@NonNull
public abstract java.lang.String getSimpleName()
Returns the simple name of this class


getPackageName

@NonNull
public java.lang.String getPackageName()
Returns the package name of this class


matches

public abstract boolean matches(@NonNull
                                java.lang.String name)
Returns whether this class' fully qualified name matches the given name


getSuperClass

@Nullable
public abstract JavaParser.ResolvedClass getSuperClass()

getInterfaces

@NonNull
public abstract java.lang.Iterable<JavaParser.ResolvedClass> getInterfaces()

getContainingClass

@Nullable
public abstract JavaParser.ResolvedClass getContainingClass()

getType

public JavaParser.TypeDescriptor getType()

isSubclassOf

public abstract boolean isSubclassOf(@NonNull
                                     java.lang.String name,
                                     boolean strict)
Determines whether this class extends the given name. If strict is true, it will not consider C extends C true.

The target must be a class; to check whether this class extends an interface, use isImplementing(String,boolean) instead. If you're not sure, use isInheritingFrom(String, boolean).

Parameters:
name - the fully qualified class name
strict - if true, do not consider a class to be extending itself
Returns:
true if this class extends the given class

isImplementing

public abstract boolean isImplementing(@NonNull
                                       java.lang.String name,
                                       boolean strict)
Determines whether this is implementing the given interface.

The target must be an interface; to check whether this class extends a class, use isSubclassOf(String, boolean) instead. If you're not sure, use isInheritingFrom(String, boolean).

Parameters:
name - the fully qualified interface name
strict - if true, do not consider a class to be extending itself
Returns:
true if this class implements the given interface

isInheritingFrom

public abstract boolean isInheritingFrom(@NonNull
                                         java.lang.String name,
                                         boolean strict)
Determines whether this class extends or implements the class of the given name. If strict is true, it will not consider C extends C true.

For performance reasons, if you know that the target is a class, consider using isSubclassOf(String, boolean) instead, and if the target is an interface, consider using isImplementing(String,boolean).

Parameters:
name - the fully qualified class name
strict - if true, do not consider a class to be inheriting from itself
Returns:
true if this class extends or implements the given class

getConstructors

@NonNull
public abstract java.lang.Iterable<JavaParser.ResolvedMethod> getConstructors()

getMethods

@NonNull
public abstract java.lang.Iterable<JavaParser.ResolvedMethod> getMethods(boolean includeInherited)
Returns the methods defined in this class, and optionally any methods inherited from any superclasses as well


getMethods

@NonNull
public abstract java.lang.Iterable<JavaParser.ResolvedMethod> getMethods(@NonNull
                                                                                 java.lang.String name,
                                                                                 boolean includeInherited)
Returns the methods of a given name defined in this class, and optionally any methods inherited from any superclasses as well


getFields

@NonNull
public abstract java.lang.Iterable<JavaParser.ResolvedField> getFields(boolean includeInherited)
Returns the fields defined in this class, and optionally any fields declared in any superclasses as well


getField

@Nullable
public abstract JavaParser.ResolvedField getField(@NonNull
                                                           java.lang.String name,
                                                           boolean includeInherited)
Returns the named field defined in this class, or optionally inherited from a superclass


getPackage

@Nullable
public abstract JavaParser.ResolvedPackage getPackage()
Returns the package containing this class


isInPackage

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

Overrides:
isInPackage in class JavaParser.ResolvedNode
Parameters:
pkg - the package name
includeSubPackages - whether to include subpackages
Returns:
true if the element is in the given package