public abstract class AbstractMethod extends AccessibleObject
Modifier and Type | Field and Description |
---|---|
protected int |
accessFlags
Bits encoding access (e.g. public, private) as well as other runtime specific flags
|
protected long |
artMethod
The ArtMethod associated with this Method, requried for dispatching due to entrypoints
Classloader is held live by the declaring class.
|
protected Class<?> |
declaringClass
Method's declaring class
|
protected Class<?> |
declaringClassOfOverriddenMethod
Overriden method's declaring class (same as declaringClass unless declaringClass
is a proxy class)
|
protected int |
dexMethodIndex
The method index of this method within its defining dex file
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractMethod()
Hidden to workaround b/16828157.
|
Modifier and Type | Method and Description |
---|---|
protected int |
compareParameters(Class<?>[] params) |
protected boolean |
equalMethodParameters(Class<?>[] params) |
boolean |
equals(Object other)
Returns true if
other has the same declaring class, name,
parameters and return type as this method. |
int |
getAccessFlags() |
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if
such an annotation is present, else null.
|
Annotation[] |
getAnnotations()
Returns all annotations present on this element.
|
Annotation[] |
getDeclaredAnnotations()
Returns all annotations that are directly present on this
element.
|
int |
getDexMethodIndex()
Returns the index of this method's ID in its dex file.
|
abstract String |
getName()
Returns the name of the method or constructor represented by this
instance.
|
abstract Annotation[][] |
getParameterAnnotations()
Returns an array of arrays that represent the annotations of the formal
parameters of this method.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType)
Returns true if an annotation for the specified type
is present on this element, else false.
|
isAccessible, setAccessible, setAccessible
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
protected int accessFlags
protected long artMethod
protected Class<?> declaringClass
protected Class<?> declaringClassOfOverriddenMethod
protected int dexMethodIndex
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
AnnotatedElement
getAnnotation
in interface AnnotatedElement
getAnnotation
in class AccessibleObject
annotationClass
- the Class object corresponding to the
annotation typepublic final int getAccessFlags()
public final int getDexMethodIndex()
public abstract String getName()
public boolean equals(Object other)
other
has the same declaring class, name,
parameters and return type as this method.equals
in class Object
other
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
public Annotation[] getDeclaredAnnotations()
AnnotatedElement
getDeclaredAnnotations
in interface AnnotatedElement
getDeclaredAnnotations
in class AccessibleObject
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
AnnotatedElement
annotationType
- the Class object corresponding to the
annotation typepublic Annotation[] getAnnotations()
AnnotatedElement
getAnnotations
in interface AnnotatedElement
getAnnotations
in class AccessibleObject
public abstract Annotation[][] getParameterAnnotations()
Annotation
instancesprotected boolean equalMethodParameters(Class<?>[] params)
protected int compareParameters(Class<?>[] params)