Package org.openjdk.jmc.common.util
Class MCMethod
- java.lang.Object
-
- org.openjdk.jmc.common.util.MCMethod
-
- All Implemented Interfaces:
IMCMethod
public class MCMethod extends java.lang.Object implements IMCMethod
Base implementation of theIMCMethodinterface.Methods in this class should not be overridden. If you want to override anything, then implement the
IMCMethodinterface instead and optionally delegate calls to this class.Please do not add utility methods to this class. Use the helper class
MethodToolkitif you want to do common utility stuff.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringm_formalDescriptorprivate java.lang.Booleanm_isNativeprivate java.lang.Stringm_methodNameprivate java.lang.Integerm_modifierprivate IMCTypem_type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetFormalDescriptor()Returns the formal descriptor.java.lang.StringgetMethodName()Returns the method name not including parameters.java.lang.IntegergetModifier()Returns the modifier used in the Java class file.IMCTypegetType()Returns the class this method is declared in.inthashCode()java.lang.BooleanisNative()Whether this method is native.
-
-
-
Field Detail
-
m_type
private final IMCType m_type
-
m_methodName
private final java.lang.String m_methodName
-
m_formalDescriptor
private final java.lang.String m_formalDescriptor
-
m_modifier
private final java.lang.Integer m_modifier
-
m_isNative
private final java.lang.Boolean m_isNative
-
-
Constructor Detail
-
MCMethod
public MCMethod(IMCType type, java.lang.String methodName, java.lang.String formalDescriptor, java.lang.Integer modifier, java.lang.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 Detail
-
getType
public final IMCType getType()
Description copied from interface:IMCMethodReturns the class this method is declared in.
-
getMethodName
public final java.lang.String getMethodName()
Description copied from interface:IMCMethodReturns the method name not including parameters.An example is "mymethod". If the method is native the format is undefined.
- Specified by:
getMethodNamein interfaceIMCMethod- Returns:
- the name of this method, or
nullif unavailable
-
getFormalDescriptor
public final java.lang.String getFormalDescriptor()
Description copied from interface:IMCMethodReturns 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:
getFormalDescriptorin interfaceIMCMethod- Returns:
- the formal method descriptor, or
nullif unavailable
-
getModifier
public final java.lang.Integer getModifier()
Description copied from interface:IMCMethodReturns the modifier used in the Java class file.Examples of modifiers are "protected", "public", etc.
See
Modifierfor more information about the bit pattern and for methods that can be used to decode it.- Specified by:
getModifierin interfaceIMCMethod- Returns:
- the modifier used in the class file, or
nullif not available
-
isNative
public final java.lang.Boolean isNative()
Description copied from interface:IMCMethodWhether this method is native.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-