Package org.jboss.weld.bootstrap.events
Class RequiredAnnotationDiscovery
java.lang.Object
org.jboss.weld.bootstrap.events.RequiredAnnotationDiscovery
- All Implemented Interfaces:
org.jboss.weld.bootstrap.api.Service
public class RequiredAnnotationDiscovery
extends Object
implements org.jboss.weld.bootstrap.api.Service
Wrapper over
ReflectionCache capable of determining whether a given class
has a given annotation or not, as defined by the CDI 1.1 specification (11.5.6).- Author:
- Jozef Hartinger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()booleancontainsAnnotation(BackedAnnotatedType<?> annotatedType, Class<? extends Annotation> requiredAnnotation) Indicates whether the given class contains an annotation of the given annotation type.
-
Constructor Details
-
RequiredAnnotationDiscovery
-
-
Method Details
-
containsAnnotation
public boolean containsAnnotation(BackedAnnotatedType<?> annotatedType, Class<? extends Annotation> requiredAnnotation) Indicates whether the given class contains an annotation of the given annotation type.
The set is referred to as M hereafter
The given class is said to contain the given annotation if any of these applies:
- The required annotation or an annotation annotated with the required annotation is present on the class
- The required annotation or an annotation annotated with the required annotation, which is annotated with
Inherited, is present on a direct or indirect superclass of the given class - The required annotation or an annotation annotated with the required annotation is present on a field or method declared by the given class or any direct or indirect superclass of the given class
- The required annotation or an annotation annotated with the required annotation is present on a parameter of a method declared by the given class or any direct or indirect superclass of the given class
- The annotation or an annotation annotated with the required annotation is present on a default method or a parameter of a default method declared by an interface directly or indirectly implemented by the given class
- The required annotation or an annotation annotated with the required annotation is present on a constructor declared by the given class
- The required annotation or an annotation annotated with the required annotation is present on a parameter of a constructor declared by the given class
- Parameters:
javaClass- the given classannotation- the given annotation type- Returns:
-
cleanup
public void cleanup()- Specified by:
cleanupin interfaceorg.jboss.weld.bootstrap.api.Service
-