Package proguard.classfile
Class MethodDescriptor
- java.lang.Object
-
- proguard.classfile.MethodDescriptor
-
public class MethodDescriptor extends java.lang.Object
Represents the descriptor that is part of aMethodSignature
. 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 Summary
Fields Modifier and Type Field Description java.util.List<java.lang.String>
argumentTypes
Deprecated.java.lang.String
returnType
Deprecated.
-
Constructor Summary
Constructors Constructor Description MethodDescriptor(java.lang.String descriptor)
MethodDescriptor(java.lang.String returnType, java.util.List<java.lang.String> argumentTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.util.List<java.lang.String>
getArgumentTypes()
java.lang.String
getPrettyArgumentTypes()
Get the human readable representation of the argument types.java.lang.String
getPrettyReturnType()
Get the human readable representation of the return type.java.lang.String
getReturnType()
int
hashCode()
boolean
isIncomplete()
Check if this descriptor is missing information.static boolean
matchesIgnoreNull(MethodDescriptor descriptor, MethodDescriptor wildcard)
Analogous to {@link MethodSignature.matchesIgnoreNull(MethodSignature, MethodSignature)}.static boolean
matchesIgnoreNullAndDollar(MethodDescriptor descriptor, MethodDescriptor wildcard)
Analogous to {@link MethodSignature.matchesIgnoreNullAndDollar(MethodSignature, MethodSignature)}.java.lang.String
toString()
-
-
-
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
- TheMethodDescriptor
to be comparedwildcard
- TheMethodDescriptor
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
- TheMethodDescriptor
to be comparedwildcard
- TheMethodDescriptor
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-