Package org.jboss.weld.util.annotated
Class AnnotatedTypeWrapper<T>
- java.lang.Object
-
- org.jboss.weld.util.annotated.ForwardingAnnotated
-
- org.jboss.weld.util.annotated.ForwardingAnnotatedType<T>
-
- org.jboss.weld.util.annotated.AnnotatedTypeWrapper<T>
-
- All Implemented Interfaces:
Annotated,AnnotatedType<T>
public class AnnotatedTypeWrapper<T> extends ForwardingAnnotatedType<T>
-
-
Constructor Summary
Constructors Constructor Description AnnotatedTypeWrapper(AnnotatedType<T> delegate, boolean keepOriginalAnnotations, Annotation... additionalAnnotations)AnnotatedTypeWrapper(AnnotatedType<T> delegate, Annotation... additionalAnnotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedType<T>delegate()<A extends Annotation>
AgetAnnotation(Class<A> annotationType)Get program element annotation of a certain annotation type.Set<Annotation>getAnnotations()Get all annotations of the program element.booleanisAnnotationPresent(Class<? extends Annotation> annotationType)Determine if the program element has an annotation of a certain annotation type.-
Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedType
getConstructors, getFields, getJavaClass, getMethods
-
Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotated
equals, getBaseType, getTypeClosure, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.Annotated
getBaseType, getTypeClosure
-
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedType
getAnnotations
-
-
-
-
Constructor Detail
-
AnnotatedTypeWrapper
public AnnotatedTypeWrapper(AnnotatedType<T> delegate, Annotation... additionalAnnotations)
-
AnnotatedTypeWrapper
public AnnotatedTypeWrapper(AnnotatedType<T> delegate, boolean keepOriginalAnnotations, Annotation... additionalAnnotations)
-
-
Method Detail
-
delegate
public AnnotatedType<T> delegate()
- Specified by:
delegatein classForwardingAnnotatedType<T>
-
getAnnotation
public <A extends Annotation> A getAnnotation(Class<A> annotationType)
Description copied from interface:AnnotatedGet program element annotation of a certain annotation type. The behavior of this method is intended to be the same behavior as
AnnotatedElement.getAnnotation(Class), where repeatable annotations are not supported.- Specified by:
getAnnotationin interfaceAnnotated- Overrides:
getAnnotationin classForwardingAnnotated- Type Parameters:
A- the type of the annotation- Parameters:
annotationType- the class of the annotation type- Returns:
- the first program element annotation of the given annotation type, or a null value
-
getAnnotations
public Set<Annotation> getAnnotations()
Description copied from interface:AnnotatedGet all annotations of the program element.
- Specified by:
getAnnotationsin interfaceAnnotated- Overrides:
getAnnotationsin classForwardingAnnotated- Returns:
- all annotations of the program element, or an empty set if no annotations are present
-
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Description copied from interface:AnnotatedDetermine if the program element has an annotation of a certain annotation type. The behavior of this method is similar to
AnnotatedElement.isAnnotationPresent(Class)for the underlying program element.- Specified by:
isAnnotationPresentin interfaceAnnotated- Overrides:
isAnnotationPresentin classForwardingAnnotated- Parameters:
annotationType- the annotation type to check for- Returns:
- true if the program element has an annotation of the given annotation type, or false otherwise
-
-