Package org.objectweb.asm.commons
Class Method
java.lang.Object
org.objectweb.asm.commons.Method
A named method descriptor.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Type[]
Returns the argument types of the method described by this object.Returns the descriptor of the method described by this object.private static String
getDescriptorInternal
(String type, boolean defaultPackage) Returns the descriptor corresponding to the given type name.static Method
getMethod
(Constructor<?> constructor) Creates a newMethod
.static Method
Creates a newMethod
.static Method
Returns aMethod
corresponding to the given Java method declaration.static Method
Returns aMethod
corresponding to the given Java method declaration.getName()
Returns the name of the method described by this object.Returns the return type of the method described by this object.int
hashCode()
toString()
-
Field Details
-
name
The method name. -
descriptor
The method descriptor. -
PRIMITIVE_TYPE_DESCRIPTORS
The descriptors of the primitive Java types (plus void).
-
-
Constructor Details
-
Method Details
-
getMethod
Creates a newMethod
.- Parameters:
method
- a java.lang.reflect method descriptor- Returns:
- a
Method
corresponding to the given Java method declaration.
-
getMethod
Creates a newMethod
.- Parameters:
constructor
- a java.lang.reflect constructor descriptor- Returns:
- a
Method
corresponding to the given Java constructor declaration.
-
getMethod
Returns aMethod
corresponding to the given Java method declaration.- Parameters:
method
- a Java method declaration, without argument names, of the form "returnType name (argumentType1, ... argumentTypeN)", where the types are in plain Java (e.g. "int", "float", "java.util.List", ...). Classes of the java.lang package can be specified by their unqualified name; all other classes names must be fully qualified.- Returns:
- a
Method
corresponding to the given Java method declaration. - Throws:
IllegalArgumentException
- ifmethod
could not get parsed.
-
getMethod
Returns aMethod
corresponding to the given Java method declaration.- Parameters:
method
- a Java method declaration, without argument names, of the form "returnType name (argumentType1, ... argumentTypeN)", where the types are in plain Java (e.g. "int", "float", "java.util.List", ...). Classes of the java.lang package may be specified by their unqualified name, depending on the defaultPackage argument; all other classes names must be fully qualified.defaultPackage
- true if unqualified class names belong to the default package, or false if they correspond to java.lang classes. For instance "Object" means "Object" if this option is true, or "java.lang.Object" otherwise.- Returns:
- a
Method
corresponding to the given Java method declaration. - Throws:
IllegalArgumentException
- ifmethod
could not get parsed.
-
getDescriptorInternal
Returns the descriptor corresponding to the given type name.- Parameters:
type
- a Java type name.defaultPackage
- true if unqualified class names belong to the default package, or false if they correspond to java.lang classes. For instance "Object" means "Object" if this option is true, or "java.lang.Object" otherwise.- Returns:
- the descriptor corresponding to the given type name.
-
getName
Returns the name of the method described by this object.- Returns:
- the name of the method described by this object.
-
getDescriptor
Returns the descriptor of the method described by this object.- Returns:
- the descriptor of the method described by this object.
-
getReturnType
Returns the return type of the method described by this object.- Returns:
- the return type of the method described by this object.
-
getArgumentTypes
Returns the argument types of the method described by this object.- Returns:
- the argument types of the method described by this object.
-
toString
-
equals
-
hashCode
public int hashCode()
-