Class MethodUtils
java.lang.Object
ch.systemsx.cisd.common.reflection.MethodUtils
Functions around
Method.-
Method Summary
Modifier and TypeMethodDescriptionstatic final StringdescribeMethod(Method method) Describes given method in following format:<class-name>.<method-name>, for instanceObject.hashCode.static final MethodReturns the currently calledMethod.static final MethodgetMethodOnStack(int level) Returns theMethodon the stack of level.static final StringReturns the specified method as string which shows method name and parameter types in a way which more compact thanMethod.toString().
-
Method Details
-
toString
Returns the specified method as string which shows method name and parameter types in a way which more compact thanMethod.toString(). -
getCurrentMethod
Returns the currently calledMethod.Returns
nullif none could be found. -
getMethodOnStack
Returns theMethodon the stack of level.level=0is this method itself,level=1is the method that called it and so forth. This method internally usesClass.getDeclaredMethods()to retrieve theMethod.IMPORTANT NOTE: You should carefully use this method in a class having more than one method with the same name. The internal idea used here (
new Throwable().getStackTrace()) only returns a method name and does not make any other consideration.- See Also:
-
describeMethod
Describes given method in following format:<class-name>.<method-name>, for instanceObject.hashCode.
-