public class MethodInfo extends Object implements Comparable<MethodInfo>
Constructor and Description |
---|
MethodInfo(String className,
String methodName,
int modifiers,
String typeDescriptor,
List<String> annotationNames) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MethodInfo other)
Sort in order of class name, method name, then type descriptor.
|
boolean |
equals(Object obj)
Test class name, method name and type descriptor for equals().
|
int |
getAccessFlags()
Returns the access flags of the method.
|
List<String> |
getAnnotationNames()
Returns the names of annotations on the method, or the empty list if none.
|
List<Class<?>> |
getAnnotationTypes()
Returns Class references for the annotations on this method.
|
String |
getClassName()
Get the name of the class this method is part of.
|
String |
getMethodName()
Returns the name of the method.
|
String |
getModifiers()
Get the method modifiers as a string, e.g.
|
List<Class<?>> |
getParameterTypes()
Returns the parameter types for the method.
|
List<String> |
getParameterTypeStrs()
Returns the parameter types for the method in string representation, e.g.
|
Class<?> |
getReturnType()
Returns the return type for the method as a Class reference.
|
String |
getReturnTypeStr()
Returns the return type for the method in string representation, e.g.
|
String |
getTypeDescriptor()
Returns the internal type descriptor for the method, e.g.
|
int |
hashCode()
Use hash code of class name, method name and type descriptor.
|
boolean |
isBridge()
Returns true if this method is a bridge method.
|
boolean |
isConstructor()
Returns true if this method is a constructor.
|
boolean |
isFinal()
Returns true if this method is final.
|
boolean |
isNative()
Returns true if this method is a native method.
|
boolean |
isPackagePrivate()
Returns true if this method is package-private.
|
boolean |
isPrivate()
Returns true if this method is private.
|
boolean |
isProtected()
Returns true if this method is protected.
|
boolean |
isPublic()
Returns true if this method is public.
|
boolean |
isStatic()
Returns true if this method is static.
|
boolean |
isSynchronized()
Returns true if this method is synchronized.
|
boolean |
isVarArgs()
Returns true if this method is a varargs method.
|
String |
toString()
Get a string representation of the method.
|
public String getModifiers()
public boolean isConstructor()
"<init>"
. This
returns false for private static class initializer blocks, which are named "<clinit>"
.public String getClassName()
public String getMethodName()
"<init>"
, and private static class
initializer blocks are named "<clinit>"
.public int getAccessFlags()
public String getTypeDescriptor()
public String getReturnTypeStr()
public Class<?> getReturnType() throws IllegalArgumentException
IllegalArgumentException
- if the return type for the method could not be loaded.public List<String> getParameterTypeStrs()
public List<Class<?>> getParameterTypes() throws IllegalArgumentException
IllegalArgumentException
- if the parameter types of the method could not be loaded.public boolean isPublic()
public boolean isPrivate()
public boolean isProtected()
public boolean isPackagePrivate()
public boolean isStatic()
public boolean isFinal()
public boolean isSynchronized()
public boolean isBridge()
public boolean isVarArgs()
public boolean isNative()
public List<String> getAnnotationNames()
public List<Class<?>> getAnnotationTypes() throws IllegalArgumentException
IllegalArgumentException
- if the annotation type could not be loaded.public boolean equals(Object obj)
public int hashCode()
public int compareTo(MethodInfo other)
compareTo
in interface Comparable<MethodInfo>
Copyright © 2017. All rights reserved.