net.sf.twip.util
Class Parameter
java.lang.Object
net.sf.twip.util.Parameter
public abstract class Parameter
- extends 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.
Field Summary |
protected int |
index
|
index
protected final int index
Parameter
public Parameter(int index)
of
public static List<Parameter> of(Method method)
of
public static List<Parameter> of(Constructor<?> constructor)
getIndex
public int getIndex()
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
- Returns:
- the annotation of that type or
null
if the parameter is not annotated
with that type.
getAnnotations
public abstract Annotation[] getAnnotations()
getType
public abstract Class<?> getType()
getMethod
public abstract Method getMethod()
isAnnotationPresent
public <T extends Annotation> boolean isAnnotationPresent(Class<T> annotationType)
isCallable
public boolean isCallable(Object value)
- Can that value be passed as this parameter? I.e. is it an instance of the correct type or (if
it's not really primitive)
null
; correctly handles primitive types where
Class.isInstance(Object)
returns false
for.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2011. All Rights Reserved.