org.objectweb.asm.commons

Class Method

public class Method extends Object

A named method descriptor.

Author: Juozas Baliuka Chris Nokleberg Eric Bruneton

Constructor Summary
Method(String name, String desc)
Creates a new {@link Method}.
Method(String name, Type returnType, Type[] argumentTypes)
Creates a new {@link Method}.
Method Summary
booleanequals(Object o)
Type[]getArgumentTypes()
Returns the argument types of the method described by this object.
StringgetDescriptor()
Returns the descriptor of the method described by this object.
static MethodgetMethod(String method)
Returns a {@link Method} corresponding to the given Java method declaration.
StringgetName()
Returns the name of the method described by this object.
TypegetReturnType()
Returns the return type of the method described by this object.
inthashCode()
StringtoString()

Constructor Detail

Method

public Method(String name, String desc)
Creates a new {@link Method}.

Parameters: name the method's name. desc the method's descriptor.

Method

public Method(String name, Type returnType, Type[] argumentTypes)
Creates a new {@link Method}.

Parameters: name the method's name. returnType the method's return type. argumentTypes the method's argument types.

Method Detail

equals

public boolean equals(Object o)

getArgumentTypes

public Type[] getArgumentTypes()
Returns the argument types of the method described by this object.

Returns: the argument types of the method described by this object.

getDescriptor

public String getDescriptor()
Returns the descriptor of the method described by this object.

Returns: the descriptor of the method described by this object.

getMethod

public static Method getMethod(String method)
Returns a {@link Method} 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", ...).

Returns: a {@link Method} corresponding to the given Java method declaration.

Throws: IllegalArgumentException if method could not get parsed.

getName

public String getName()
Returns the name of the method described by this object.

Returns: the name of the method described by this object.

getReturnType

public Type getReturnType()
Returns the return type of the method described by this object.

Returns: the return type of the method described by this object.

hashCode

public int hashCode()

toString

public String toString()