|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HMethod
An HMethod
provides information about, and access to, a
single method on a class or interface. The reflected method
may be a class method or an instance method (including an abstract
method).
HMember
,
HClass
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface harpoon.ClassFile.HMember |
---|
HMember.MemberComparator |
Field Summary | |
---|---|
static ArrayFactory<HMethod> |
arrayFactory
Array factory: returns new HMethod[] . |
Fields inherited from interface harpoon.ClassFile.HMember |
---|
memberComparator |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Compares this HMethod against the specified object. |
HClass |
getDeclaringClass()
Returns the HClass object representing the class or
interface that declares the method represented by this
HMethod object. |
String |
getDescriptor()
Returns the descriptor for this method. |
HClass[] |
getExceptionTypes()
Returns an array of HClass objects that represent the
types of the checked exceptions thrown by the underlying method
represented by this HMethod object. |
HType[] |
getGenericParameterTypes()
Returns an array of HType objects that represent the
formal parameter types, in declaration order, of the method
represented by this HMethod object. |
HType |
getGenericReturnType()
Returns an HType object that represents the formal
return type of the method represented by this
HMethod object. |
int |
getModifiers()
Returns the Java language modifiers for the method represented by this HMethod object, as an integer. |
HMethodMutator |
getMutator()
Returns a mutator for this HMethod , or null
if the object is immutable. |
String |
getName()
Returns the name of the method represented by this HMethod
object, as a String . |
String[] |
getParameterNames()
Returns an array of String objects giving the declared
names of the formal parameters of the method. |
HClass[] |
getParameterTypes()
Returns an array of HClass objects that represent the
formal parameter types, in declaration order, of the method
represented by this HMethod object. |
HClass |
getReturnType()
Returns a HClass object that represents the formal
return type of the method represented by this HMethod
object. |
HMethodTypeVariable[] |
getTypeParameters()
Returns an array of HMethodTypeVariable objects that
represent the type variables declared by the method represented
by this HMethod object, in declaration order. |
boolean |
isInterfaceMethod()
Determines whether this HMethod is an interface method. |
boolean |
isStatic()
Determines whether this is a static method. |
boolean |
isSynthetic()
Determines whether this HMethod is synthetic,
in the sense of "associated with an inner-class; not programmer
declared". |
String |
toString()
Returns a string describing this HMethod . |
Methods inherited from interface harpoon.ClassFile.HMember |
---|
compareTo, hashCode |
Field Detail |
---|
static final ArrayFactory<HMethod> arrayFactory
HMethod[]
.
Method Detail |
---|
HClass getDeclaringClass()
HClass
object representing the class or
interface that declares the method represented by this
HMethod
object.
getDeclaringClass
in interface HMember
String getName()
HMethod
object, as a String
.
getName
in interface HMember
int getModifiers()
HMethod
object, as an integer. The
java.lang.reflect.Modifier
class should be used to decode the modifiers.
getModifiers
in interface HMember
Modifier
HClass getReturnType()
HClass
object that represents the formal
return type of the method represented by this HMethod
object. Returns HClass.Void
if the method returns
no value.
String getDescriptor()
getDescriptor
in interface HMember
HClass[] getParameterTypes()
HClass
objects that represent the
formal parameter types, in declaration order, of the method
represented by this HMethod
object. Returns an array
of length 0 is the underlying method takes no parameters.
String[] getParameterNames()
String
objects giving the declared
names of the formal parameters of the method. The length of the
returned array is equal to the number of formal parameters.
If there is no LocalVariableTable
attribute available
for this method, then every element of the returned array will be
null
.
HClass[] getExceptionTypes()
HClass
objects that represent the
types of the checked exceptions thrown by the underlying method
represented by this HMethod
object. Returns an array
of length 0 if the method throws no checked exceptions.
boolean isSynthetic()
HMethod
is synthetic,
in the sense of "associated with an inner-class; not programmer
declared".
isSynthetic
in interface HMember
boolean isInterfaceMethod()
HMethod
is an interface method.
boolean isStatic()
HMethodMutator getMutator()
HMethod
, or null
if the object is immutable.
boolean equals(Object obj)
HMethod
against the specified object.
Returns true
if the objects are the same. Two
HMethod
s are the same if they were declared by the same
class and have the same name and formal parameter types.
equals
in class Object
String toString()
HMethod
. The string
is formatted as the method access modifiers, if any, followed by
the method return type, followed by a space, followed by the class
declaring the method, followed by a period, followed by the method
name, followed by a parenthesized, comma-separated list of the
method's formal parameter types. If the method throws checked
exceptions, the parameter list is followed by a space, followed
by the word throws followed by a comma-separated list of the
throws exception types. For example:
public boolean java.lang.Object.equals(java.lang.Object)
The access modifiers are placed in canonical order as specified by
"The Java Language Specification." This is
public
, protected
, or private
first, and then other modifiers in the following order:
abstract
, static
, final
,
synchronized
, native
.
toString
in class Object
HType[] getGenericParameterTypes()
HType
objects that represent the
formal parameter types, in declaration order, of the method
represented by this HMethod
object. Returns an
array of length 0 if the underlying method takes no parameters.
In particular, if the compile-time type of any formal parameter
is a type variable or a parameterized type, than an object of the
appropriate type (i.e., HTypeVariable
or
HParameterizedType
) will be returned.
HType getGenericReturnType()
HType
object that represents the formal
return type of the method represented by this
HMethod
object. In particular, if the compile-time
return type a parameterized type, than an object of the
appropriate type (i.e., HTypeVariable
or
HParameterizedType
will be returned.
HMethodTypeVariable[] getTypeParameters()
HMethodTypeVariable
objects that
represent the type variables declared by the method represented
by this HMethod
object, in declaration order.
Returns an array of length 0 if the underlying method declares no
type variables.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |