< prev index next >
src/java.base/share/classes/java/lang/reflect/Parameter.java
Print this page
*** 278,296 ****
--- 278,299 ----
}
/**
* {@inheritDoc}
+ * <p>Any annotation returned by this method is a declaration annotation.
* @throws NullPointerException {@inheritDoc}
*/
+ @Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
Objects.requireNonNull(annotationClass);
return annotationClass.cast(declaredAnnotations().get(annotationClass));
}
/**
* {@inheritDoc}
+ * <p>Any annotations returned by this method are declaration annotations.
* @throws NullPointerException {@inheritDoc}
*/
@Override
public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
Objects.requireNonNull(annotationClass);
*** 298,323 ****
--- 301,333 ----
return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass);
}
/**
* {@inheritDoc}
+ * <p>Any annotations returned by this method are declaration annotations.
*/
+ @Override
public Annotation[] getDeclaredAnnotations() {
return executable.getParameterAnnotations()[index];
}
/**
+ * {@inheritDoc}
+ * <p>Any annotation returned by this method is a declaration annotation.
* @throws NullPointerException {@inheritDoc}
*/
+ @Override
public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
// Only annotations on classes are inherited, for all other
// objects getDeclaredAnnotation is the same as
// getAnnotation.
return getAnnotation(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Any annotations returned by this method are declaration annotations.
* @throws NullPointerException {@inheritDoc}
*/
@Override
public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) {
// Only annotations on classes are inherited, for all other
*** 326,336 ****
--- 336,348 ----
return getAnnotationsByType(annotationClass);
}
/**
* {@inheritDoc}
+ * <p>Any annotations returned by this method are declaration annotations.
*/
+ @Override
public Annotation[] getAnnotations() {
return getDeclaredAnnotations();
}
private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
< prev index next >