Class MethodDescriptor


  • public class MethodDescriptor
    extends java.lang.Object
    Represents the descriptor that is part of a MethodSignature. A descriptor consists of parameter types and return type of a method, e.g. "()V" for a void method with no parameters, or "(II)B" for a method that takes two integers and returns a boolean. Read more about this topic in ยง4.3.3 of the JVM specification.
    • Field Detail

      • returnType

        @Deprecated
        public final java.lang.String returnType
        Deprecated.
      • argumentTypes

        @Deprecated
        public final java.util.List<java.lang.String> argumentTypes
        Deprecated.
    • Constructor Detail

      • MethodDescriptor

        public MethodDescriptor​(java.lang.String descriptor)
      • MethodDescriptor

        public MethodDescriptor​(java.lang.String returnType,
                                java.util.List<java.lang.String> argumentTypes)
    • Method Detail

      • isIncomplete

        public boolean isIncomplete()
        Check if this descriptor is missing information.
      • getReturnType

        public java.lang.String getReturnType()
      • getArgumentTypes

        public java.util.List<java.lang.String> getArgumentTypes()
      • matchesIgnoreNull

        public static boolean matchesIgnoreNull​(MethodDescriptor descriptor,
                                                MethodDescriptor wildcard)
        Analogous to {@link MethodSignature.matchesIgnoreNull(MethodSignature, MethodSignature)}.
        Parameters:
        descriptor - The MethodDescriptor to be compared
        wildcard - The MethodDescriptor pattern to be matched against
        Returns:
        true if the two objects match
      • matchesIgnoreNullAndDollar

        public static boolean matchesIgnoreNullAndDollar​(MethodDescriptor descriptor,
                                                         MethodDescriptor wildcard)
        Analogous to {@link MethodSignature.matchesIgnoreNullAndDollar(MethodSignature, MethodSignature)}.
        Parameters:
        descriptor - The MethodDescriptor to be compared
        wildcard - The MethodDescriptor pattern to be matched against
        Returns:
        true if the two objects match
      • getPrettyReturnType

        public java.lang.String getPrettyReturnType()
        Get the human readable representation of the return type. E.g. "void" for "V" or "?" for an undefined return type.
        Returns:
        The human readable representation of returnType
      • getPrettyArgumentTypes

        public java.lang.String getPrettyArgumentTypes()
        Get the human readable representation of the argument types. E.g. "String,int" for "(Ljava/lang/String;I)".
        Returns:
        The human readable representation of argumentTypes
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object