Class EnhancedAnnotatedTypeImpl<T>
java.lang.Object
org.jboss.weld.annotated.enhanced.jlr.AbstractEnhancedAnnotated<T,Class<T>>
org.jboss.weld.annotated.enhanced.jlr.EnhancedAnnotatedTypeImpl<T>
- Type Parameters:
T- the type of the class
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.Annotated,jakarta.enterprise.inject.spi.AnnotatedType<T>,EnhancedAnnotated<T,,Class<T>> EnhancedAnnotatedType<T>
- Direct Known Subclasses:
EnhancedAnnotationImpl
public class EnhancedAnnotatedTypeImpl<T>
extends AbstractEnhancedAnnotated<T,Class<T>>
implements EnhancedAnnotatedType<T>
Represents an annotated class
This class is immutable, and therefore threadsafe
- Author:
- Pete Muir, David Allen, Ales Justin
-
Field Summary
Fields inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotated
MAPPED_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnhancedAnnotatedTypeImpl(SlimAnnotatedType<T> annotatedType, Map<Class<? extends Annotation>, Annotation> annotationMap, Map<Class<? extends Annotation>, Annotation> declaredAnnotationMap, ClassTransformer classTransformer) -
Method Summary
Modifier and TypeMethodDescription<U> EnhancedAnnotatedType<? extends U>asEnhancedSubclass(EnhancedAnnotatedType<U> clazz) protected Multimap<Class<? extends Annotation>,EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) protected Multimap<Class<? extends Annotation>,EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedParameterMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) <S> SbooleanGets the implementing classGet the constructor which matches the argument list provided<F> EnhancedAnnotatedField<F,?> getDeclaredEnhancedField(String fieldName) Get a field by nameCollection<EnhancedAnnotatedField<?,? super T>> Gets all fields declared on this class only.Collection<EnhancedAnnotatedField<?,? super T>> getDeclaredEnhancedFields(Class<? extends Annotation> annotationType) Gets all fields which are annotated with the given annotation type on this class only.<M> EnhancedAnnotatedMethod<M,?> getDeclaredEnhancedMethod(MethodSignature signature) Get a method by nameCollection<EnhancedAnnotatedMethod<?,? super T>> Gets all methods on the typeCollection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethods(Class<? extends Annotation> annotationType) Gets all methods annotated with annotationTypeCollection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType) Gets declared with parameters annotated with annotationTypegetDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType) Gets all annotations which are declared on this annotated item with the given meta annotation typeGets the delegate (class)Gets all constructorsgetEnhancedConstructors(Class<? extends Annotation> annotationType) Gets constructors with given annotation typeCollection<EnhancedAnnotatedField<?,? super T>> Gets the abstracted fields of the classgetEnhancedFields(Class<? extends Annotation> annotationType) Gets the abstracted field annotated with a specific annotation type<M> EnhancedAnnotatedMethod<M,?> getEnhancedMethod(MethodSignature signature) Get a method by nameCollection<EnhancedAnnotatedMethod<?,? super T>> Gets all methods on the type including those declared on a superclass ofEnhancedAnnotated.getJavaClass().Collection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethods(Class<? extends Annotation> annotationType) Gets the abstracted methods that have a certain annotation type presentCollection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType) Gets all methods with parameters annotated with annotationType including those declared on a superclass ofEnhancedAnnotated.getJavaClass().EnhancedAnnotatedType<? super T>Gets the superclass abstraction of the typegetName()Gets the name of the typeGets the no-args constructorprotected Set<EnhancedAnnotatedMethod<?,? super T>> getOverriddenMethods(EnhancedAnnotatedType<T> annotatedType, Set<EnhancedAnnotatedMethod<?, ? super T>> methods) protected Set<EnhancedAnnotatedMethod<?,? super T>> getOverriddenMethods(EnhancedAnnotatedType<T> annotatedType, Set<EnhancedAnnotatedMethod<?, ? super T>> methods, boolean skipOverridingBridgeMethods) inthashCode()booleanbooleanbooleanbooleanisEnum()booleanisEquivalent(Class<?> clazz) Check if this is equivalent to a java classbooleanisFinal()Indicates if the type if finalbooleanbooleanbooleanbooleanbooleanbooleanisPublic()Indicates if this annotated item is publicbooleanisSealed()Indicates if thisEnhancedAnnotatedTyperepresents a sealed class/interfacebooleanbooleanisStatic()Indicates if the type is staticstatic <T> EnhancedAnnotatedType<T>of(SlimAnnotatedType<T> annotatedType, ClassTransformer classTransformer) slim()Returns a lightweight implementation ofAnnotatedTypewith minimal memory footprint.toString()Gets a string representation of the classMethods inherited from class org.jboss.weld.annotated.enhanced.jlr.AbstractEnhancedAnnotated
addMetaAnnotations, buildAnnotationMap, getActualTypeArguments, getAnnotation, getAnnotations, getBaseType, getInterfaceClosure, getJavaClass, getMetaAnnotations, getQualifiers, getTypeClosure, isAnnotationPresent, isParameterizedType, isPrimitive, processMetaAnnotations, processMetaAnnotations, processMetaAnnotationsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jakarta.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresentMethods inherited from interface jakarta.enterprise.inject.spi.AnnotatedType
getAnnotations, getJavaClassMethods inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotated
getActualTypeArguments, getBindingsAsArray, getInterfaceClosure, getJavaClass, getMetaAnnotations, getQualifiers, isPrimitiveMethods inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType
isParameterizedType
-
Constructor Details
-
EnhancedAnnotatedTypeImpl
protected EnhancedAnnotatedTypeImpl(SlimAnnotatedType<T> annotatedType, Map<Class<? extends Annotation>, Annotation> annotationMap, Map<Class<? extends Annotation>, Annotation> declaredAnnotationMap, ClassTransformer classTransformer)
-
-
Method Details
-
of
public static <T> EnhancedAnnotatedType<T> of(SlimAnnotatedType<T> annotatedType, ClassTransformer classTransformer) -
getOverriddenMethods
protected Set<EnhancedAnnotatedMethod<?,? super T>> getOverriddenMethods(EnhancedAnnotatedType<T> annotatedType, Set<EnhancedAnnotatedMethod<?, ? super T>> methods) -
getOverriddenMethods
protected Set<EnhancedAnnotatedMethod<?,? super T>> getOverriddenMethods(EnhancedAnnotatedType<T> annotatedType, Set<EnhancedAnnotatedMethod<?, ? super T>> methods, boolean skipOverridingBridgeMethods) - Parameters:
annotatedType-methods-skipOverridingBridgeMethods- If set totruethe returning set will not contain methods overriden by a bridge method- Returns:
- the set of overriden methods
-
buildAnnotatedMethodMultimap
protected Multimap<Class<? extends Annotation>,EnhancedAnnotatedMethod<?, buildAnnotatedMethodMultimap? super T>> (Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) -
buildAnnotatedParameterMethodMultimap
protected Multimap<Class<? extends Annotation>,EnhancedAnnotatedMethod<?, buildAnnotatedParameterMethodMultimap? super T>> (Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) -
getAnnotatedClass
Gets the implementing class- Returns:
- The class
-
getDelegate
Gets the delegate (class)- Specified by:
getDelegatein classAbstractEnhancedAnnotated<T,Class<T>> - Returns:
- The class
-
getEnhancedFields
Gets the abstracted fields of the class Initializes the fields if they are null- Specified by:
getEnhancedFieldsin interfaceEnhancedAnnotatedType<T>- Returns:
- The set of abstracted fields
-
getDeclaredEnhancedFields
Description copied from interface:EnhancedAnnotatedTypeGets all fields declared on this class only.- Specified by:
getDeclaredEnhancedFieldsin interfaceEnhancedAnnotatedType<T>- Returns:
- A set of abstracted fields. Returns an empty set if there are no matches
-
getDeclaredEnhancedField
Description copied from interface:EnhancedAnnotatedTypeGet a field by name- Specified by:
getDeclaredEnhancedFieldin interfaceEnhancedAnnotatedType<T>- Type Parameters:
F- the expected type of the field- Parameters:
fieldName- the field name- Returns:
- the field
-
getDeclaredEnhancedFields
public Collection<EnhancedAnnotatedField<?,? super T>> getDeclaredEnhancedFields(Class<? extends Annotation> annotationType) Description copied from interface:EnhancedAnnotatedTypeGets all fields which are annotated with the given annotation type on this class only.- Specified by:
getDeclaredEnhancedFieldsin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation to match- Returns:
- A set of abstracted fields with the given annotation. Returns an empty set if there are no matches
-
getDeclaredEnhancedConstructor
public EnhancedAnnotatedConstructor<T> getDeclaredEnhancedConstructor(ConstructorSignature signature) Description copied from interface:EnhancedAnnotatedTypeGet the constructor which matches the argument list provided- Specified by:
getDeclaredEnhancedConstructorin interfaceEnhancedAnnotatedType<T>- Returns:
- the matching constructor, or null if not defined
-
getEnhancedFields
public Collection<EnhancedAnnotatedField<?,?>> getEnhancedFields(Class<? extends Annotation> annotationType) Gets the abstracted field annotated with a specific annotation type If the fields map is null, initialize it first- Specified by:
getEnhancedFieldsin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation type to match- Returns:
- A set of matching abstracted fields, null if none are found.
-
isLocalClass
public boolean isLocalClass()- Specified by:
isLocalClassin interfaceEnhancedAnnotatedType<T>
-
isAnonymousClass
public boolean isAnonymousClass()- Specified by:
isAnonymousClassin interfaceEnhancedAnnotatedType<T>
-
isSealed
public boolean isSealed()Description copied from interface:EnhancedAnnotatedTypeIndicates if thisEnhancedAnnotatedTyperepresents a sealed class/interface- Specified by:
isSealedin interfaceEnhancedAnnotatedType<T>- Returns:
- True if sealed, false otherwise
-
isMemberClass
public boolean isMemberClass()- Specified by:
isMemberClassin interfaceEnhancedAnnotatedType<T>
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstractin interfaceEnhancedAnnotatedType<T>
-
isEnum
public boolean isEnum()- Specified by:
isEnumin interfaceEnhancedAnnotatedType<T>
-
isSerializable
public boolean isSerializable()- Specified by:
isSerializablein interfaceEnhancedAnnotatedType<T>
-
getEnhancedMethods
public Collection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethods(Class<? extends Annotation> annotationType) Gets the abstracted methods that have a certain annotation type present- Specified by:
getEnhancedMethodsin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation type to match- Returns:
- A set of matching method abstractions. Returns an empty set if no matches are found.
- See Also:
-
getDeclaredEnhancedMethods
public Collection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethods(Class<? extends Annotation> annotationType) Description copied from interface:EnhancedAnnotatedTypeGets all methods annotated with annotationType- Specified by:
getDeclaredEnhancedMethodsin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
getEnhancedConstructors
Description copied from interface:EnhancedAnnotatedTypeGets all constructors- Specified by:
getEnhancedConstructorsin interfaceEnhancedAnnotatedType<T>
-
getEnhancedConstructors
public Collection<EnhancedAnnotatedConstructor<T>> getEnhancedConstructors(Class<? extends Annotation> annotationType) Gets constructors with given annotation type- Specified by:
getEnhancedConstructorsin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation type to match- Returns:
- A set of abstracted constructors with given annotation type. If the constructors set is empty, initialize it first. Returns an empty set if there are no matches.
- See Also:
-
getNoArgsEnhancedConstructor
Description copied from interface:EnhancedAnnotatedTypeGets the no-args constructor- Specified by:
getNoArgsEnhancedConstructorin interfaceEnhancedAnnotatedType<T>- Returns:
- The no-args constructor, or null if not defined
-
getDeclaredEnhancedMethodsWithAnnotatedParameters
public Collection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType) Description copied from interface:EnhancedAnnotatedTypeGets declared with parameters annotated with annotationType- Specified by:
getDeclaredEnhancedMethodsWithAnnotatedParametersin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
getEnhancedMethods
Description copied from interface:EnhancedAnnotatedTypeGets all methods on the type including those declared on a superclass ofEnhancedAnnotated.getJavaClass(). Overridden methods are not returned.- Specified by:
getEnhancedMethodsin interfaceEnhancedAnnotatedType<T>- Returns:
- A set of abstracted methods
-
getDeclaredEnhancedMethods
Description copied from interface:EnhancedAnnotatedTypeGets all methods on the type- Specified by:
getDeclaredEnhancedMethodsin interfaceEnhancedAnnotatedType<T>- Returns:
- A set of abstracted methods
-
getDeclaredEnhancedMethod
Description copied from interface:EnhancedAnnotatedTypeGet a method by name- Specified by:
getDeclaredEnhancedMethodin interfaceEnhancedAnnotatedType<T>- Type Parameters:
M- the expected return type- Parameters:
signature- the name of the method- Returns:
- the method, or null if it doesn't exist
-
getEnhancedMethod
Description copied from interface:EnhancedAnnotatedTypeGet a method by name- Specified by:
getEnhancedMethodin interfaceEnhancedAnnotatedType<T>- Type Parameters:
M- the expected return type- Parameters:
signature- the name of the method- Returns:
- the method, or null if it doesn't exist
-
toString
Gets a string representation of the class -
getSimpleName
- Specified by:
getSimpleNamein interfaceEnhancedAnnotatedType<T>
-
isStatic
public boolean isStatic()Indicates if the type is static- Specified by:
isStaticin interfaceEnhancedAnnotated<T,Class<T>> - Returns:
- True if static, false otherwise
- See Also:
-
isFinal
public boolean isFinal()Indicates if the type if final- Specified by:
isFinalin interfaceEnhancedAnnotated<T,Class<T>> - Returns:
- True if final, false otherwise
- See Also:
-
isPublic
public boolean isPublic()Description copied from interface:EnhancedAnnotatedIndicates if this annotated item is public- Specified by:
isPublicin interfaceEnhancedAnnotated<T,Class<T>> - Returns:
- if public, returns true
-
isGeneric
public boolean isGeneric()- Specified by:
isGenericin interfaceEnhancedAnnotated<T,Class<T>>
-
getName
Gets the name of the type- Specified by:
getNamein interfaceEnhancedAnnotated<T,Class<T>> - Returns:
- The name
- See Also:
-
getEnhancedSuperclass
Gets the superclass abstraction of the type- Specified by:
getEnhancedSuperclassin interfaceEnhancedAnnotatedType<T>- Returns:
- The superclass abstraction
-
isEquivalent
Description copied from interface:EnhancedAnnotatedTypeCheck if this is equivalent to a java class- Specified by:
isEquivalentin interfaceEnhancedAnnotatedType<T>- Parameters:
clazz- The Java class- Returns:
- true if equivalent
-
isPrivate
public boolean isPrivate()- Specified by:
isPrivatein interfaceEnhancedAnnotated<T,Class<T>>
-
isPackagePrivate
public boolean isPackagePrivate()- Specified by:
isPackagePrivatein interfaceEnhancedAnnotated<T,Class<T>>
-
getPackage
- Specified by:
getPackagein interfaceEnhancedAnnotated<T,Class<T>>
-
asEnhancedSubclass
- Specified by:
asEnhancedSubclassin interfaceEnhancedAnnotatedType<T>
-
cast
- Specified by:
castin interfaceEnhancedAnnotatedType<T>
-
getConstructors
- Specified by:
getConstructorsin interfacejakarta.enterprise.inject.spi.AnnotatedType<T>
-
getFields
- Specified by:
getFieldsin interfacejakarta.enterprise.inject.spi.AnnotatedType<T>
-
getMethods
- Specified by:
getMethodsin interfacejakarta.enterprise.inject.spi.AnnotatedType<T>
-
getDeclaredMetaAnnotations
Description copied from interface:EnhancedAnnotatedTypeGets all annotations which are declared on this annotated item with the given meta annotation type- Specified by:
getDeclaredMetaAnnotationsin interfaceEnhancedAnnotatedType<T>- Returns:
- A set of matching meta-annotations. Returns an empty set if there are no matches.
-
isDiscovered
public boolean isDiscovered()- Specified by:
isDiscoveredin interfaceEnhancedAnnotatedType<T>
-
slim
Description copied from interface:EnhancedAnnotatedTypeReturns a lightweight implementation ofAnnotatedTypewith minimal memory footprint.- Specified by:
slimin interfaceEnhancedAnnotated<T,Class<T>> - Specified by:
slimin interfaceEnhancedAnnotatedType<T>- Returns:
- the slim version of this
AnnotatedType
-
getEnhancedMethodsWithAnnotatedParameters
public Collection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType) Description copied from interface:EnhancedAnnotatedTypeGets all methods with parameters annotated with annotationType including those declared on a superclass ofEnhancedAnnotated.getJavaClass(). Overridden methods are not returned.- Specified by:
getEnhancedMethodsWithAnnotatedParametersin interfaceEnhancedAnnotatedType<T>- Parameters:
annotationType- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
hashCode
public int hashCode() -
equals
-