public class MethodDesc extends Descriptor implements Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
static MethodDesc |
forArguments(TypeDesc ret,
TypeDesc[] params)
Acquire a MethodDesc from a set of arguments.
|
static MethodDesc |
forDescriptor(String desc)
Acquire a MethodDesc from a type descriptor.
|
static MethodDesc |
forMethod(Method method) |
String |
getDescriptor()
Returns a method descriptor string, excluding generics.
|
int |
getParameterCount() |
TypeDesc[] |
getParameterTypes() |
TypeDesc |
getReturnType()
Returns the described return type, which is TypeDesc.VOID if void.
|
int |
hashCode() |
String |
toMethodSignature(String name)
Returns this in Java method signature syntax.
|
String |
toMethodSignature(String name,
boolean varargs)
Returns this in Java method signature syntax.
|
String |
toString() |
parse
public static MethodDesc forArguments(TypeDesc ret, TypeDesc[] params)
ret
- return type of method; null implies voidparams
- parameters to method; null implies nonepublic static MethodDesc forDescriptor(String desc) throws IllegalArgumentException
IllegalArgumentException
public static MethodDesc forMethod(Method method)
public String getDescriptor()
getDescriptor
in class Descriptor
public TypeDesc getReturnType()
public int getParameterCount()
public TypeDesc[] getParameterTypes()
public String toMethodSignature(String name)
name
- method namepublic String toMethodSignature(String name, boolean varargs)
name
- method namevarargs
- request that the last argument, if it is an array, to
be formatted in varargs syntax.Copyright © 2004-2015 Cojen. All Rights Reserved.