public class MCMethod extends java.lang.Object implements IMCMethod
IMCMethod
interface.
Methods in this class should not be overridden. If you want to override anything, then implement
the IMCMethod
interface instead and optionally delegate calls to this class.
Please do not add utility methods to this class. Use the helper class MethodToolkit
if
you want to do common utility stuff.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
m_formalDescriptor |
private java.lang.Boolean |
m_isNative |
private java.lang.String |
m_methodName |
private java.lang.Integer |
m_modifier |
private IMCType |
m_type |
Constructor and Description |
---|
MCMethod(IMCType type,
java.lang.String methodName,
java.lang.String formalDescriptor,
java.lang.Integer modifier,
java.lang.Boolean isNative)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getFormalDescriptor()
Returns the formal descriptor.
|
java.lang.String |
getMethodName()
Returns the method name not including parameters.
|
java.lang.Integer |
getModifier()
Returns the modifier used in the Java class file.
|
IMCType |
getType()
Returns the class this method is declared in.
|
int |
hashCode() |
java.lang.Boolean |
isHidden()
Whether this method is hidden.
|
java.lang.Boolean |
isNative()
Whether this method is native.
|
private final IMCType m_type
private final java.lang.String m_methodName
private final java.lang.String m_formalDescriptor
private final java.lang.Integer m_modifier
private final java.lang.Boolean m_isNative
public MCMethod(IMCType type, java.lang.String methodName, java.lang.String formalDescriptor, java.lang.Integer modifier, java.lang.Boolean isNative)
type
- the class that this method is declared inmethodName
- the method nameformalDescriptor
- the formal descriptor, see IMCMethod.getFormalDescriptor()
modifier
- method modifier bit pattern, see IMCMethod.getModifier()
isNative
- whether the method is native, see IMCMethod.isNative()
public final IMCType getType()
IMCMethod
public final java.lang.String getMethodName()
IMCMethod
An example is "mymethod". If the method is native the format is undefined.
getMethodName
in interface IMCMethod
null
if unavailablepublic final java.lang.String getFormalDescriptor()
IMCMethod
For example, the method descriptor for the method
Object mymethod(int i, double d, Thread t)
is
(IDLjava/lang/Thread;)Ljava/lang/Object;
getFormalDescriptor
in interface IMCMethod
null
if unavailablepublic final java.lang.Integer getModifier()
IMCMethod
Examples of modifiers are "protected", "public", etc.
See Modifier
for more information about the bit pattern and for methods that can be
used to decode it.
getModifier
in interface IMCMethod
null
if not availablepublic final java.lang.Boolean isNative()
IMCMethod
public final java.lang.Boolean isHidden()
IMCMethod
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object