Class AbstractEnhancedAnnotated<T,S>
java.lang.Object
org.jboss.weld.annotated.enhanced.jlr.AbstractEnhancedAnnotated<T,S>
- Type Parameters:
T-S-
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.Annotated,EnhancedAnnotated<T,S>
- Direct Known Subclasses:
AbstractEnhancedAnnotatedMember,EnhancedAnnotatedParameterImpl,EnhancedAnnotatedTypeImpl
public abstract class AbstractEnhancedAnnotated<T,S>
extends Object
implements EnhancedAnnotated<T,S>
Represents functionality common for all annotated items, mainly different
mappings of the annotations and meta-annotations
AbstractAnnotatedItem is an immutable class and therefore threadsafe
- Author:
- Pete Muir, Nicklas Karlsson
- See Also:
-
Field Summary
Fields inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotated
MAPPED_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEnhancedAnnotated(jakarta.enterprise.inject.spi.Annotated annotated, Map<Class<? extends Annotation>, Annotation> annotationMap, Map<Class<? extends Annotation>, Annotation> declaredAnnotationMap, ClassTransformer classTransformer) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, Iterable<Annotation> metaAnnotations, boolean declared) protected static Map<Class<? extends Annotation>,Annotation> buildAnnotationMap(Iterable<Annotation> annotations) Builds the annotation map (annotation type -> annotation)Type[]Gets the actual type arguments for any parameterized types that this AnnotatedItem represents.<A extends Annotation>
AgetAnnotation(Class<A> annotationType) abstract SGet the type hierarchy of any interfaces implemented by this class.Gets the type of the elementgetMetaAnnotations(Class<? extends Annotation> metaAnnotationType) Gets all annotations which are annotated with the given meta annotation typeGets the binding types for this elementbooleanisAnnotationPresent(Class<? extends Annotation> annotationType) booleanbooleanprotected voidprocessMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation[] annotations, ClassTransformer classTransformer, boolean declared) protected voidprocessMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, ClassTransformer classTransformer, boolean declared) protected voidprocessMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Collection<Annotation> annotations, ClassTransformer classTransformer, boolean declared) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.enterprise.inject.spi.Annotated
getAnnotationsMethods inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotated
getBindingsAsArray, getName, getPackage, isFinal, isGeneric, isPackagePrivate, isPrivate, isPublic, isStatic, slim
-
Constructor Details
-
AbstractEnhancedAnnotated
public AbstractEnhancedAnnotated(jakarta.enterprise.inject.spi.Annotated annotated, Map<Class<? extends Annotation>, Annotation> annotationMap, Map<Class<? extends Annotation>, Annotation> declaredAnnotationMap, ClassTransformer classTransformer) Constructor Also builds the meta-annotation map. Throws a NullPointerException if trying to register a null map- Parameters:
annotationMap- A map of annotation to register
-
-
Method Details
-
buildAnnotationMap
protected static Map<Class<? extends Annotation>,Annotation> buildAnnotationMap(Iterable<Annotation> annotations) Builds the annotation map (annotation type -> annotation)- Parameters:
annotations- The array of annotations to map- Returns:
- The annotation map
-
addMetaAnnotations
protected static void addMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, Iterable<Annotation> metaAnnotations, boolean declared) -
processMetaAnnotations
protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Collection<Annotation> annotations, ClassTransformer classTransformer, boolean declared) -
processMetaAnnotations
protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation[] annotations, ClassTransformer classTransformer, boolean declared) -
processMetaAnnotations
protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, ClassTransformer classTransformer, boolean declared) -
getJavaClass
Description copied from interface:EnhancedAnnotatedGets the type of the element- Specified by:
getJavaClassin interfaceEnhancedAnnotated<T,S> - Returns:
- The type of the element
-
getActualTypeArguments
Description copied from interface:EnhancedAnnotatedGets the actual type arguments for any parameterized types that this AnnotatedItem represents.- Specified by:
getActualTypeArgumentsin interfaceEnhancedAnnotated<T,S> - Returns:
- An array of type arguments
-
getInterfaceClosure
Description copied from interface:EnhancedAnnotatedGet the type hierarchy of any interfaces implemented by this class. The returned types should have any type parameters resolved to their actual types. There is no guarantee this methods executes in O(1) time- Specified by:
getInterfaceClosurein interfaceEnhancedAnnotated<T,S> - Returns:
- the type hierarchy
-
getDelegate
-
isParameterizedType
public boolean isParameterizedType()- Specified by:
isParameterizedTypein interfaceEnhancedAnnotated<T,S>
-
isPrimitive
public boolean isPrimitive()- Specified by:
isPrimitivein interfaceEnhancedAnnotated<T,S>
-
getBaseType
- Specified by:
getBaseTypein interfacejakarta.enterprise.inject.spi.Annotated
-
getTypeClosure
- Specified by:
getTypeClosurein interfacejakarta.enterprise.inject.spi.Annotated
-
getAnnotations
- Specified by:
getAnnotationsin interfacejakarta.enterprise.inject.spi.Annotated
-
getMetaAnnotations
Description copied from interface:EnhancedAnnotatedGets all annotations which are annotated with the given meta annotation type- Specified by:
getMetaAnnotationsin interfaceEnhancedAnnotated<T,S> - Returns:
- A set of matching meta-annotations. Returns an empty set if there are no matches.
-
getQualifiers
Description copied from interface:EnhancedAnnotatedGets the binding types for this elementThis reflection type should not know about CDI qualifiers. However, it is very convenient, so we keep it here.
- Specified by:
getQualifiersin interfaceEnhancedAnnotated<T,S>
-
getAnnotation
- Specified by:
getAnnotationin interfacejakarta.enterprise.inject.spi.Annotated
-
isAnnotationPresent
- Specified by:
isAnnotationPresentin interfacejakarta.enterprise.inject.spi.Annotated
-