< prev index next >
src/java.base/share/classes/java/lang/reflect/AccessibleObject.java
Print this page
@@ -507,13 +507,18 @@
static final ReflectionFactory reflectionFactory =
AccessController.doPrivileged(
new ReflectionFactory.GetReflectionFactoryAction());
/**
+ * {@inheritDoc}
+ * <p>Note that any annotation returned by this method is a
+ * declaration annotation.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
+ @Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
throw new AssertionError("All subclasses should override this method");
}
/**
@@ -525,26 +530,39 @@
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
return AnnotatedElement.super.isAnnotationPresent(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@Override
public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
throw new AssertionError("All subclasses should override this method");
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @since 1.5
*/
+ @Override
public Annotation[] getAnnotations() {
return getDeclaredAnnotations();
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotation returned by this method is a
+ * declaration annotation.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@Override
public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
@@ -553,10 +571,14 @@
// getAnnotation.
return getAnnotation(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are a
+ * declaration annotations.
+ *
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@Override
public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) {
@@ -565,12 +587,17 @@
// getAnnotationsByType.
return getAnnotationsByType(annotationClass);
}
/**
+ * {@inheritDoc}
+ * <p>Note that any annotations returned by this method are
+ * declaration annotations.
+ *
* @since 1.5
*/
+ @Override
public Annotation[] getDeclaredAnnotations() {
throw new AssertionError("All subclasses should override this method");
}
// Shared access checking logic.
< prev index next >