Package org.openjdk.jmc.common.util
Class MCMethod
java.lang.Object
org.openjdk.jmc.common.util.MCMethod
- All Implemented Interfaces:
IMCMethod
Base implementation of the
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
final String
Returns the formal descriptor.final String
Returns the method name not including parameters.final Integer
Returns the modifier used in the Java class file.final IMCType
getType()
Returns the class this method is declared in.int
hashCode()
final Boolean
isHidden()
Whether this method is hidden.final Boolean
isNative()
Whether this method is native.
-
Constructor Details
-
MCMethod
public MCMethod(IMCType type, String methodName, String formalDescriptor, Integer modifier, Boolean isNative) Create a new instance.- Parameters:
type
- the class that this method is declared inmethodName
- the method nameformalDescriptor
- the formal descriptor, seeIMCMethod.getFormalDescriptor()
modifier
- method modifier bit pattern, seeIMCMethod.getModifier()
isNative
- whether the method is native, seeIMCMethod.isNative()
-
-
Method Details
-
getType
Description copied from interface:IMCMethod
Returns the class this method is declared in. -
getMethodName
Description copied from interface:IMCMethod
Returns the method name not including parameters.An example is "mymethod". If the method is native the format is undefined.
- Specified by:
getMethodName
in interfaceIMCMethod
- Returns:
- the name of this method, or
null
if unavailable
-
getFormalDescriptor
Description copied from interface:IMCMethod
Returns the formal descriptor.For example, the method descriptor for the method
Object mymethod(int i, double d, Thread t)
is(IDLjava/lang/Thread;)Ljava/lang/Object;
- Specified by:
getFormalDescriptor
in interfaceIMCMethod
- Returns:
- the formal method descriptor, or
null
if unavailable
-
getModifier
Description copied from interface:IMCMethod
Returns the modifier used in the Java class file.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.- Specified by:
getModifier
in interfaceIMCMethod
- Returns:
- the modifier used in the class file, or
null
if not available
-
isNative
Description copied from interface:IMCMethod
Whether this method is native. -
isHidden
Description copied from interface:IMCMethod
Whether this method is hidden. -
hashCode
public int hashCode() -
equals
-