Class MethodTypeInfo


  • public final class MethodTypeInfo
    extends Object
    A CONSTANT_MethodType entry wrapping a method descriptor with parsing helpers.
    • Constructor Detail

      • MethodTypeInfo

        public MethodTypeInfo​(String descriptor)
        Creates a method type wrapper.
        Parameters:
        descriptor - the method descriptor to parse
    • Method Detail

      • getDescriptor

        public String getDescriptor()
        Returns:
        the descriptor
      • getReturnType

        public String getReturnType()
        Extracts the return type from the descriptor.
        Returns:
        the return type descriptor, or "V" if it cannot be parsed
      • isVoidReturn

        public boolean isVoidReturn()
        Checks whether the method type returns void.
        Returns:
        true if the return type is "V"
      • getParameterCount

        public int getParameterCount()
        Counts the parameters declared in the descriptor.
        Returns:
        the number of parameters
      • getParameterTypes

        public String[] getParameterTypes()
        Parses the parameter type descriptors out of the method descriptor.
        Returns:
        the parameter descriptors in order, empty for a missing or malformed descriptor
      • getParameterSlots

        public int getParameterSlots()
        Counts the local-variable slots consumed by the parameters.
        Returns:
        the total slot count, with long and double counting as two