Parameter provides information about method parameters,
including its name and modifiers. It also provides an alternate
means of obtaining attributes for the parameter.
| Modifier and Type | Field and Description |
|---|---|
| private transient Map | |
| private final Executable | |
| private final int | |
| private final int | |
| private final String | |
| private transient volatile Class | |
| private transient volatile Type |
| Access | Constructor and Description |
|---|---|
| pack-priv | Parameter(String
The name of the parameter, or name, int null if absentThe modifier flags for the parameter. modifiers, Executable The executable which defines this parameter. executable, int The index of the parameter. index)Package-private constructor for |
| Modifier and Type | Method and Description |
|---|---|
| public Set | Returns: an unmodifiable set of the access flags for the parameter represented by this object, possibly emptyReturns an unmodifiable set of the access flags for the parameter represented by this object, possibly empty. |
| private synchronized Map | |
| public boolean | Returns: Whether or not this is equal to the argument.The object to compare. obj)Overrides java. Compares based on the executable and the index. |
| public AnnotatedType | Returns: anAnnotatedType object representing the use of a type
to specify the type of the formal parameter represented by this
ParameterReturns an AnnotatedType object that represents the use of a type to specify the type of the formal parameter represented by this Parameter. |
| public <T extends Annotation> T | getAnnotation(Class<T> annotationClass)
Implements java. Returns this element's annotation for the specified type if such an annotation is present, else null. |
| public Annotation[] | getAnnotations()
Implements java. Returns annotations that are present on this element. |
| public <T extends Annotation> T[] | getAnnotationsByType(Class<T> annotationClass)
Overrides default java. Returns annotations that are associated with this element. |
| public <T extends Annotation> T | getDeclaredAnnotation(Class<T> annotationClass)
Overrides default java. Returns this element's annotation for the specified type if such an annotation is directly present, else null. |
| public Annotation[] | getDeclaredAnnotations()
Implements java. Returns annotations that are directly present on this element. |
| public <T extends Annotation> T[] | getDeclaredAnnotationsByType(Class<T> annotationClass)
Overrides default java. Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present. |
| public Executable | Returns: theExecutable declaring this parameterReturns the |
| public int | Returns: the Java language modifiers for the parameter represented by this objectReturns the Java language modifiers for the parameter represented by this object. |
| public String | Returns: The name of the parameter, either provided by the class file or synthesized if the class file does not provide a name.Returns the name of the parameter. |
| public Type | Returns: aType object identifying the parameterized
type of the parameter represented by this objectReturns a |
| pack-priv String | |
| public Class | Returns: aClass object identifying the declared
type of the parameter represented by this objectReturns a |
| public int | Returns: A hash code based on the executable's hash code.Overrides java. Returns a hash code based on the executable's hash code and the index. |
| public boolean | Returns: true if and only if this parameter is implicitly declared as defined by The Java Language Specification.Returns |
| public boolean | Returns: true if and only if the parameter has a name according to the class file.Returns true if the parameter has a name according to the class file; returns false otherwise. |
| public boolean | Returns: true if and only if this parameter is a synthetic construct as defined by The Java Language Specification.Returns |
| public boolean | Returns: true if an only if this parameter represents a
variable argument list.Returns |
| public String | Returns: A string representation of the parameter and associated information.Overrides java. Returns a string describing this parameter. |
| declaredAnnotations | back to summary |
|---|---|
| private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations | |
| executable | back to summary |
|---|---|
| private final Executable executable | |
| index | back to summary |
|---|---|
| private final int index | |
| modifiers | back to summary |
|---|---|
| private final int modifiers | |
| name | back to summary |
|---|---|
| private final String name | |
| parameterClassCache | back to summary |
|---|---|
| private transient volatile Class<?> parameterClassCache | |
| parameterTypeCache | back to summary |
|---|---|
| private transient volatile Type parameterTypeCache | |
| Parameter | back to summary |
|---|---|
| pack-priv Parameter(String name, int modifiers, Executable executable, int index) Package-private constructor for
| |
| accessFlags | back to summary |
|---|---|
| public Set Returns an unmodifiable set of the access flags for the parameter represented by this object, possibly empty.
| |
| declaredAnnotations | back to summary |
|---|---|
| private synchronized Map | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Compares based on the executable and the index. | |
| getAnnotatedType | back to summary |
|---|---|
| public AnnotatedType getAnnotatedType() Returns an AnnotatedType object that represents the use of a type to specify the type of the formal parameter represented by this Parameter.
| |
| getAnnotation | back to summary |
|---|---|
| public <T extends Annotation> T getAnnotation(Class<T> annotationClass) Implements java. Doc from java. Returns this element's annotation for the specified type if such an annotation is present, else null. Note that any annotation returned by this method is a declaration annotation.
| |
| getAnnotations | back to summary |
|---|---|
| public Annotation[] getAnnotations() Implements java. Doc from java. Returns annotations that are present on this element. If there are no annotations present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers. Note that any annotations returned by this method are declaration annotations.
| |
| getAnnotationsByType | back to summary |
|---|---|
| public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) Overrides default java. Doc from java. Returns annotations that are associated with this element.
If there are no annotations associated with this element, the return
value is an array of length 0.
The difference between this method and Note that any annotations returned by this method are declaration annotations.
| |
| getDeclaredAnnotation | back to summary |
|---|---|
| public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) Overrides default java. Doc from java. Returns this element's annotation for the specified type if such an annotation is directly present, else null. This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.) Note that any annotation returned by this method is a declaration annotation.
| |
| getDeclaredAnnotations | back to summary |
|---|---|
| public Annotation[] getDeclaredAnnotations() Implements java. Doc from java. Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers. Note that any annotations returned by this method are declaration annotations.
| |
| getDeclaredAnnotationsByType | back to summary |
|---|---|
| public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) Overrides default java. Doc from java. Returns this element's annotation(s) for the specified type if
such annotations are either directly present or
indirectly present. This method ignores inherited
annotations.
If there are no specified annotations directly or indirectly
present on this element, the return value is an array of length
0.
The difference between this method and Note that any annotations returned by this method are declaration annotations.
| |
| getDeclaringExecutable | back to summary |
|---|---|
| public Executable getDeclaringExecutable() Returns the
| |
| getModifiers | back to summary |
|---|---|
| public int getModifiers() Returns the Java language modifiers for the parameter represented by this object.
| |
| getName | back to summary |
|---|---|
| public String getName() Returns the name of the parameter. 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.
| |
| getParameterizedType | back to summary |
|---|---|
| public Type getParameterizedType() Returns a
| |
| getRealName | back to summary |
|---|---|
| pack-priv String getRealName() | |
| getType | back to summary |
|---|---|
| public Class Returns a
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code based on the executable's hash code and the index.
| |
| isImplicit | back to summary |
|---|---|
| public boolean isImplicit() Returns
| |
| isNamePresent | back to summary |
|---|---|
| public boolean isNamePresent() Returns true if the parameter has a name according to the class file; returns false otherwise. Whether a parameter has a name is determined by the MethodParameters attribute of the method which declares the parameter.
| |
| isSynthetic | back to summary |
|---|---|
| public boolean isSynthetic() Returns
| |
| isVarArgs | back to summary |
|---|---|
| public boolean isVarArgs() Returns
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string describing this parameter. The format is the modifiers for the parameter, if any, in canonical order as recommended by The Java Language Specification, followed by the fully-qualified type of the parameter (excluding the last [] if the parameter is variable arity), followed by "..." if the parameter is variable arity, followed by a space, followed by the name of the parameter. | |