src/share/classes/java/lang/reflect/AccessibleObject.java

Print this page




 164     // NOTE: for security purposes, this field must not be visible
 165     // outside this package.
 166     boolean override;
 167 
 168     // Reflection factory used by subclasses for creating field,
 169     // method, and constructor accessors. Note that this is called
 170     // very early in the bootstrapping process.
 171     static final ReflectionFactory reflectionFactory =
 172         AccessController.doPrivileged(
 173             new sun.reflect.ReflectionFactory.GetReflectionFactoryAction());
 174 
 175     /**
 176      * @throws NullPointerException {@inheritDoc}
 177      * @since 1.5
 178      */
 179     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
 180         throw new AssertionError("All subclasses should override this method");
 181     }
 182 
 183     /**










 184      * @throws NullPointerException {@inheritDoc}
 185      * @since 1.8
 186      */
 187     @Override
 188     public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
 189         throw new AssertionError("All subclasses should override this method");
 190     }
 191 
 192     /**
 193      * @since 1.5
 194      */
 195     public Annotation[] getAnnotations() {
 196         return getDeclaredAnnotations();
 197     }
 198 
 199     /**
 200      * @throws NullPointerException {@inheritDoc}
 201      * @since 1.8
 202      */
 203     @Override




 164     // NOTE: for security purposes, this field must not be visible
 165     // outside this package.
 166     boolean override;
 167 
 168     // Reflection factory used by subclasses for creating field,
 169     // method, and constructor accessors. Note that this is called
 170     // very early in the bootstrapping process.
 171     static final ReflectionFactory reflectionFactory =
 172         AccessController.doPrivileged(
 173             new sun.reflect.ReflectionFactory.GetReflectionFactoryAction());
 174 
 175     /**
 176      * @throws NullPointerException {@inheritDoc}
 177      * @since 1.5
 178      */
 179     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
 180         throw new AssertionError("All subclasses should override this method");
 181     }
 182 
 183     /**
 184      * {@inheritDoc}
 185      * @throws NullPointerException {@inheritDoc}
 186      * @since 1.5
 187      */
 188     @Override
 189     public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
 190         return AnnotatedElement.super.isAnnotationPresent(annotationClass);
 191     }
 192 
 193    /**
 194      * @throws NullPointerException {@inheritDoc}
 195      * @since 1.8
 196      */
 197     @Override
 198     public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
 199         throw new AssertionError("All subclasses should override this method");
 200     }
 201 
 202     /**
 203      * @since 1.5
 204      */
 205     public Annotation[] getAnnotations() {
 206         return getDeclaredAnnotations();
 207     }
 208 
 209     /**
 210      * @throws NullPointerException {@inheritDoc}
 211      * @since 1.8
 212      */
 213     @Override