Class MCMethod

java.lang.Object
org.openjdk.jmc.common.util.MCMethod
All Implemented Interfaces:
IMCMethod

public class MCMethod extends Object implements 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 Details

  • Method Details

    • getType

      public final IMCType getType()
      Description copied from interface: IMCMethod
      Returns the class this method is declared in.
      Specified by:
      getType in interface IMCMethod
      Returns:
      the class declaring this method
    • getMethodName

      public final String 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 interface IMCMethod
      Returns:
      the name of this method, or null if unavailable
    • getFormalDescriptor

      public final String 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 interface IMCMethod
      Returns:
      the formal method descriptor, or null if unavailable
    • getModifier

      public final Integer 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 interface IMCMethod
      Returns:
      the modifier used in the class file, or null if not available
    • isNative

      public final Boolean isNative()
      Description copied from interface: IMCMethod
      Whether this method is native.
      Specified by:
      isNative in interface IMCMethod
      Returns:
      Boolean.TRUE if the method is native, Boolean.FALSE if not, or null if the information is not available
    • isHidden

      public final Boolean isHidden()
      Description copied from interface: IMCMethod
      Whether this method is hidden.
      Specified by:
      isHidden in interface IMCMethod
      Returns:
      Boolean.TRUE if the method is hidden, Boolean.FALSE if not, or null if the information is not available
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object