|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.plastic.MethodDescription
public class MethodDescription
Describes a PlasticMethod
in terms of a method name, a set of modifiers
(public, private, static, final, etc.), a return type, types of method arguments,
and types of checked exceptions. Types are represented as Java source names:
either names of primitives ("void", "byte", "long") or fully qualified class names ("java.lang.Object",
"java.lang.Runnable"). ASM refers to this as "class name".
MethodDescriptions are immutable, and properly implement equals() and hashCode(); they are often used as keys in Maps.
The natural sort order for a MethodDescription is ascending order by method name, then descending order by number of parameters (for the same name). Sort order is not currently specified for overrides of the same method with the same number of parameters.
TODO: Handling generic types.
Field Summary | |
---|---|
String[] |
argumentTypes
A non-null array of Java source names for arguments. |
String[] |
checkedExceptionTypes
A non-null array of Java source names for checked exceptions. |
String |
genericSignature
|
String |
methodName
The name of the method. |
int |
modifiers
The full set of modifier flags for the method. |
String |
returnType
The Java source name for the return type, e.g., "void", "short", "java.util.Map", "java.lang.String[]". |
Constructor Summary | |
---|---|
MethodDescription(int modifiers,
String returnType,
String methodName,
String[] argumentTypes,
String genericSignature,
String[] checkedExceptionTypes)
|
|
MethodDescription(Method method)
Creates a MethodDescription from a Java Method. |
|
MethodDescription(String returnType,
String methodName,
String... argumentTypes)
Convenience constructor for public methods that have no checked exceptions. |
Method Summary | |
---|---|
int |
compareTo(MethodDescription o)
|
boolean |
equals(Object obj)
|
int |
hashCode()
|
String |
toShortString()
A string used to identify the method, containing just the method name and argument types (but ignoring visibility, return type and thrown exceptions). |
String |
toString()
|
MethodDescription |
withModifiers(int newModifiers)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int modifiers
public final String returnType
public final String methodName
public final String genericSignature
public final String[] argumentTypes
public final String[] checkedExceptionTypes
Constructor Detail |
---|
public MethodDescription(String returnType, String methodName, String... argumentTypes)
returnType
- return type as type namemethodName
- name of methodargumentTypes
- type names for argumentspublic MethodDescription(int modifiers, String returnType, String methodName, String[] argumentTypes, String genericSignature, String[] checkedExceptionTypes)
modifiers
- returnType
- Java source name for the return typemethodName
- argumentTypes
- may be nullgenericSignature
- TODOcheckedExceptionTypes
- may be nullpublic MethodDescription(Method method)
Method Detail |
---|
public MethodDescription withModifiers(int newModifiers)
public int compareTo(MethodDescription o)
compareTo
in interface Comparable<MethodDescription>
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public String toShortString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |