|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cojen.classfile.Descriptor
org.cojen.classfile.MethodDesc
public class MethodDesc
This class is used to build method descriptor strings as defined in The Java Virtual Machine Specification, section 4.3.3. MethodDesc instances are canonicalized and therefore "==" comparable.
Method Summary | |
---|---|
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()
|
Methods inherited from class org.cojen.classfile.Descriptor |
---|
parse |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
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.public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |