@BeanIgnore public final class ParamInfo extends Object
Modifier | Constructor and Description |
---|---|
protected |
ParamInfo(ExecutableInfo eInfo,
Parameter p,
int index)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getAnnotation(Class<T> a)
Finds the annotation of the specified type defined on this method parameter.
|
<T extends Annotation> |
getAnnotations(Class<T> a)
Returns all annotations of the specified type defined on this method parameter.
|
<T extends Annotation> |
getAnnotationsParentFirst(Class<T> a)
Identical to
getAnnotations(Class) but returns the list in reverse (parent-to-child) order. |
ConstructorInfo |
getConstructor()
Returns the constructor that this parameter belongs to.
|
<T extends Annotation> |
getDeclaredAnnotation(Class<T> a)
Returns the specified parameter annotation declared on this parameter.
|
Annotation[] |
getDeclaredAnnotations()
Returns the parameter annotations declared on this parameter.
|
int |
getIndex()
Returns the index position of this parameter.
|
MethodInfo |
getMethod()
Returns the method that this parameter belongs to.
|
String |
getName()
Returns the name of the parameter.
|
ClassInfo |
getParameterType()
Returns the class type of this parameter.
|
boolean |
hasAnnotation(Class<? extends Annotation> a)
Returns
|
boolean |
hasName()
Returns
|
String |
toString() |
protected ParamInfo(ExecutableInfo eInfo, Parameter p, int index)
eInfo
- The constructor or method wrapper.p
- The parameter being wrapped.index
- The parameter index.public int getIndex()
public MethodInfo getMethod()
public ConstructorInfo getConstructor()
public ClassInfo getParameterType()
public Annotation[] getDeclaredAnnotations()
public <T extends Annotation> T getDeclaredAnnotation(Class<T> a)
T
- The annotation type.a
- The annotation to search for.public <T extends Annotation> T getAnnotation(Class<T> a)
If the annotation cannot be found on the immediate method, searches methods with the same
signature on the parent classes or interfaces.
The search is performed in child-to-parent order.
If still not found, searches for the annotation on the return type of the method.
a
- The annotation to search for.public boolean hasAnnotation(Class<? extends Annotation> a)
a
- The annotation to search for.public <T extends Annotation> List<T> getAnnotations(Class<T> a)
Searches all methods with the same signature on the parent classes or interfaces and the return type on the method.
a
- The annotation to search for.public <T extends Annotation> List<T> getAnnotationsParentFirst(Class<T> a)
getAnnotations(Class)
but returns the list in reverse (parent-to-child) order.a
- The annotation to search for.public boolean hasName()
public String getName()
If the parameter's name is present, then this method returns the name provided by the class file. Otherwise, this method synthesizes a name of the form argN, where N is the index of the parameter in the descriptor of the method which declares the parameter.
Parameter.getName()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.