All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----harpoon.ClassFile.HMethod
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).
HMethod
against the specified object.
HClass
object representing the class or
interface that declares the method represented by this
HMethod
object.
HClass
objects that represent the
types of the checked exceptions thrown by the underlying method
represented by this HMethod
object.
HMethod
object, as an integer.
HMethod
object, as a String
.
String
objects giving the declared
names of the formal parameters of the method.
HClass
objects that represent the
formal parameter types, in declaration order, of the method
represented by this HMethod
object.
HClass
object that represents the formal
return type of the method represented by this HMethod
object.
HMethod
.
HMethod
is an interface method.
HMethod
is synthetic.
The 'codetype' string used for getCode
is
the value of the getName
method of
codeobj
.
HCodeFactory
to be used by the
getCode
method.
HMethod
.
public HMethod()
public static void register(HCodeFactory f)
HCodeFactory
to be used by the
getCode
method.
public HCode getCode(String codetype)
codetype
defined by default is "bytecode",
which returns an harpoon.IR.Bytecode.Code
object,
but other codetype
s can be registered using the
register()
method.
The getCode()
method will use any registered
HCodeFactory
s in order to create the HCode
requested.
null
if no factory for the codetype
can be found.
null
is typically also returned for native methods.
public void putCode(HCode codeobj)
The 'codetype' string used for getCode
is
the value of the getName
method of
codeobj
.
null
to delete a previously existing representation.
public HClass getDeclaringClass()
HClass
object representing the class or
interface that declares the method represented by this
HMethod
object.
public String getName()
HMethod
object, as a String
.
public int getModifiers()
HMethod
object, as an integer. The
java.lang.reflect.Modifier
class should be used to decode the modifiers.
public HClass getReturnType()
HClass
object that represents the formal
return type of the method represented by this HMethod
object.
public String getDescriptor()
public 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.
public 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
.
public 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.
public boolean isSynthetic()
HMethod
is synthetic.
public boolean isInterfaceMethod()
HMethod
is an interface method.
public boolean isStatic()
public 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.
public int hashCode()
HMethod
. The hashcode
is computed as the exclusive-or of the hashcodes for the
underlying method's declaring class, the method's name,
and the method's descriptor string.
public 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
.
All Packages Class Hierarchy This Package Previous Next Index