public class MCMethod extends 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.
| Constructor and Description |
|---|
MCMethod(IMCType type,
String methodName,
String formalDescriptor,
Integer modifier,
Boolean isNative)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getFormalDescriptor()
Returns the formal descriptor.
|
String |
getMethodName()
Returns the method name not including parameters.
|
Integer |
getModifier()
Returns the modifier used in the Java class file.
|
IMCType |
getType()
Returns the class this method is declared in.
|
int |
hashCode() |
Boolean |
isNative()
Whether this method is native.
|
public MCMethod(IMCType type, String methodName, String formalDescriptor, Integer modifier, 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()
IMCMethodpublic final String getMethodName()
IMCMethodAn example is "mymethod". If the method is native the format is undefined.
getMethodName in interface IMCMethodnull if unavailablepublic final 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 IMCMethodnull if unavailablepublic final Integer getModifier()
IMCMethodExamples 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 IMCMethodnull if not availablepublic final Boolean isNative()
IMCMethodCopyright © 2019. All rights reserved.