Class MethodTypeSignature


  • public class MethodTypeSignature
    extends HierarchicalTypeSignature
    A method type signature (called "MethodSignature" in the classfile documentation).
    • Constructor Detail

      • MethodTypeSignature

        public MethodTypeSignature​(List<TypeParameter> typeParameters,
                                   List<TypeSignature> paramTypes,
                                   TypeSignature resultType,
                                   List<ClassRefOrTypeVariableSignature> throwsSignatures)
        Parameters:
        typeParameters - The type parameters for the method.
        paramTypes - The parameter types for the method.
        resultType - The result type for the method.
        throwsSignatures - The throws signatures for the method.
    • Method Detail

      • getTypeParameters

        public List<TypeParameter> getTypeParameters()
        Get the type parameters for the method.
        Returns:
        The type parameters for the method.
      • getParameterTypeSignatures

        public List<TypeSignature> getParameterTypeSignatures()
        Get the type signatures of the method parameters.
        Returns:
        The parameter types for the method, as TypeSignature parsed type objects.
      • getResultType

        public TypeSignature getResultType()
        Get the result type for the method.
        Returns:
        The result type for the method, as a TypeSignature parsed type object.
      • hashCode

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

        public static MethodTypeSignature parse​(String typeDescriptor)
                                         throws Parser.ParseException
        Parse a method signature (ignores class context, i.e. no ClassInfo needs to be provided -- this means that type variables cannot be resolved to the matching type parameter).
        Parameters:
        typeDescriptor - The low-level internal method type descriptor or type signature to parse.
        Returns:
        The parsed type signature of the method.
        Throws:
        Parser.ParseException - If method type signature could not be parsed.