net.sf.twip.util
Class Parameter
java.lang.Object
net.sf.twip.util.Parameter
public class Parameter
- extends java.lang.Object
In java.lang.reflect
the parameters are not first class
citizens: you can only access them by several index methods, and the name is
not kept in the class file. This class tries to fill that gap as good as it
goes.
Constructor Summary |
Parameter(java.lang.reflect.Method method,
int index)
|
Method Summary |
<T extends java.lang.annotation.Annotation>
T |
|
getAnnotation(java.lang.Class<T> annotationType)
|
java.lang.annotation.Annotation[] |
getAnnotations()
|
int |
getIndex()
|
java.lang.reflect.Method |
getMethod()
|
java.lang.Class<?> |
getType()
|
<T extends java.lang.annotation.Annotation>
boolean |
|
isAnnotationPresent(java.lang.Class<T> annotationType)
|
static java.util.List<Parameter> |
of(java.lang.reflect.Method method)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Parameter
public Parameter(java.lang.reflect.Method method,
int index)
of
public static java.util.List<Parameter> of(java.lang.reflect.Method method)
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)
- Returns:
- the annotation of that type or
null
if the parameter
is not annotated with that type.
getAnnotations
public java.lang.annotation.Annotation[] getAnnotations()
getIndex
public int getIndex()
getMethod
public java.lang.reflect.Method getMethod()
getType
public java.lang.Class<?> getType()
isAnnotationPresent
public <T extends java.lang.annotation.Annotation> boolean isAnnotationPresent(java.lang.Class<T> annotationType)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2010. All Rights Reserved.