ReflWrap
Class MethodInfo

java.lang.Object
  extended by ReflWrap.MethodInfo

public class MethodInfo
extends java.lang.Object

Wrapper around java.lang.reflect.Method Retrieve information about methods at runtime


Field Summary
private  java.lang.reflect.Method m
          The Method object
private  java.lang.String name
          Name of the method
private  java.lang.String[] params
          Types of this method's parameters
 
Constructor Summary
MethodInfo(java.lang.reflect.Method method)
          Constructor from a Method object
 
Method Summary
 java.lang.Class _class()
          Get the declaring class of this method
<T extends java.lang.annotation.Annotation>
T
anot(java.lang.Class<T> klass)
          Returns this element's annotation for the specified type if such an annotation is present, else null
private  int determineID()
          Determines the position of this method in the Method array of BCEL
 java.lang.annotation.Annotation[] getParamAnot(int i)
          Get all annotations associated with a parameter
 java.lang.Class[] getParams()
          Get parameter types of this method
 boolean isStatic()
          Checks whether this method is static
 java.lang.reflect.Method m()
          Get the Method object itself
 java.lang.String modifiersToString()
          Convert all modifiers of this method to a string
 java.lang.String name()
          Get the name of the method
 java.lang.String[] params()
          Get parameter types of this method
 java.lang.String paramsToString()
          Convert all parameters to a single string
 ClassInfo returns()
          Get the return value type of the method
 java.lang.String returnsT()
          Return value with template parameters
 java.lang.String toSimpleString()
          Returns a string representation of this object which can be compared to strings retrieved by BCEL
 java.lang.String toString()
          Get a string representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m

private java.lang.reflect.Method m
The Method object


name

private java.lang.String name
Name of the method


params

private java.lang.String[] params
Types of this method's parameters

Constructor Detail

MethodInfo

public MethodInfo(java.lang.reflect.Method method)
Constructor from a Method object

Parameters:
method - Existing Method object
Method Detail

_class

public java.lang.Class _class()
Get the declaring class of this method

Returns:
Declaring class

m

public java.lang.reflect.Method m()
Get the Method object itself

Returns:
Method object

name

public java.lang.String name()
Get the name of the method

Returns:
Name

returns

public ClassInfo returns()
Get the return value type of the method

Returns:
Return value

determineID

private int determineID()
Determines the position of this method in the Method array of BCEL

Returns:
Position

returnsT

public java.lang.String returnsT()
Return value with template parameters

Returns:
String

params

public java.lang.String[] params()
Get parameter types of this method

Returns:
Array of parameter types

getParams

public java.lang.Class[] getParams()
Get parameter types of this method

Returns:
Array of parameter types

toString

public java.lang.String toString()
Get a string representation of this object

Overrides:
toString in class java.lang.Object
Returns:
String

paramsToString

public java.lang.String paramsToString()
Convert all parameters to a single string

Returns:
String with all parameters

isStatic

public boolean isStatic()
Checks whether this method is static

Returns:
True if static, false if not

modifiersToString

public java.lang.String modifiersToString()
Convert all modifiers of this method to a string

Returns:
String containing all modifiers

getParamAnot

public java.lang.annotation.Annotation[] getParamAnot(int i)
Get all annotations associated with a parameter

Parameters:
i - Index number of the parameter
Returns:
Array of Annotation objects

anot

public <T extends java.lang.annotation.Annotation> T anot(java.lang.Class<T> klass)
Returns this element's annotation for the specified type if such an annotation is present, else null

Parameters:
klass - Specified type
Returns:
Element's annotation

toSimpleString

public java.lang.String toSimpleString()
Returns a string representation of this object which can be compared to strings retrieved by BCEL

Returns:
String