Class AnnotationManager

java.lang.Object
org.apache.webbeans.annotation.AnnotationManager

public final class AnnotationManager extends Object
Manages annotation usage by classes in this application.
  • Constructor Details

  • Method Details

    • getDeclaredScopeAnnotation

      public Annotation getDeclaredScopeAnnotation(Class<?> beanClass)
    • isInterceptorBindingAnnotation

      public boolean isInterceptorBindingAnnotation(Class<? extends Annotation> clazz)
      Returns true if the annotation is defined in xml or annotated with InterceptorBinding or an InterceptorBinding registered via BeforeBeanDiscovery. False otherwise.
      Parameters:
      clazz - type of the annotation
      Returns:
      true if the annotation is defined in xml or annotated with InterceptorBinding, false otherwise
    • getInterceptorAnnotations

      public Set<Annotation> getInterceptorAnnotations(Set<Annotation> typeAnns)
      This method searches for all direct and indirect annotations which represent an InterceptorBinding. InterceptorBindings in stereotypes will also be found!
      Returns:
      the effective interceptor annotations of the array of given annotations
    • hasInterceptorBindingMetaAnnotation

      public boolean hasInterceptorBindingMetaAnnotation(Annotation[] anns)
      If any Annotations in the input is an interceptor binding annotation type then return true, false otherwise.
      Parameters:
      anns - array of Annotations to check
      Returns:
      true if one or moe of the input annotations are an interceptor binding annotation type false otherwise
    • getInterceptorBindingMetaAnnotations

      public Annotation[] getInterceptorBindingMetaAnnotations(Set<Annotation> anns)
      Collect the interceptor bindings from an array of annotations, including transitively defined interceptor bindings.
      Parameters:
      anns - An array of annotations
      Returns:
      an array of interceptor binding annotations, including the input and any transitively declared annotations
    • getInterceptorBindingMetaAnnotations

      public Annotation[] getInterceptorBindingMetaAnnotations(Annotation[] anns)
      Collect the interceptor bindings from an array of annotations, including transitively defined interceptor bindings.
      Parameters:
      anns - An array of annotations
      Returns:
      an array of interceptor binding annotations, including the input and any transitively declared annotations
    • isQualifierAnnotation

      public boolean isQualifierAnnotation(Class<? extends Annotation> clazz)
      Returns true if the annotation is defined in xml or annotated with Qualifier false otherwise.
      Parameters:
      clazz - type of the annotation
      Returns:
      true if the annotation is defined in xml or annotated with Qualifier false otherwise
    • getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation

      public <X> Annotation[] getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation(jakarta.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod, Class<? extends Annotation> clazz)
    • getMethodFirstParameterQualifierWithGivenAnnotation

      public Annotation[] getMethodFirstParameterQualifierWithGivenAnnotation(Method method, Class<? extends Annotation> clazz)
      Gets the method first found parameter qualifiers.
      Parameters:
      method - method
      clazz - checking annotation
      Returns:
      annotation array
    • getQualifierAnnotations

      public Annotation[] getQualifierAnnotations(Annotation... annotations)
    • getQualifierAnnotations

      public Set<Annotation> getQualifierAnnotations(Collection<Annotation> anns)
      Gets the array of qualifier annotations on the given array.
      Parameters:
      anns - annotation array
      Returns:
      array containing qualifier anns
    • checkQualifierConditions

      public void checkQualifierConditions(Annotation... qualifierAnnots)
    • checkQualifierConditions

      public void checkQualifierConditions(Set<Annotation> qualifierAnnots)
      This function obviously cannot check for duplicate annotations. So this must have been done before!
      Parameters:
      qualifierAnnots -
    • checkQualifierConditions

      public void checkQualifierConditions(Annotation ann)
    • isStereoTypeAnnotation

      public boolean isStereoTypeAnnotation(Class<? extends Annotation> clazz)
      Returns true if the annotation is defined in xml or annotated with Stereotype false otherwise.
      Parameters:
      clazz - type of the annotation
      Returns:
      true if the annotation is defined in xml or annotated with Stereotype false otherwise
    • hasStereoTypeMetaAnnotation

      public boolean hasStereoTypeMetaAnnotation(Set<Class<? extends Annotation>> anns)
    • hasStereoTypeMetaAnnotation

      public boolean hasStereoTypeMetaAnnotation(Annotation[] anns)
    • getStereotypeMetaAnnotations

      public Annotation[] getStereotypeMetaAnnotations(Annotation[] anns)
    • getStereotypeMetaAnnotations

      public Set<Class<? extends Annotation>> getStereotypeMetaAnnotations(Set<Class<? extends Annotation>> stereotypes)
    • getStereotypes

      public Set<Class<? extends Annotation>> getStereotypes(Set<Class<? extends Annotation>> anns)
      Returns bean stereotypes.
      Returns:
      bean stereotypes
    • hasNamedOnStereoTypes

      public boolean hasNamedOnStereoTypes(Set<Class<? extends Annotation>> stereotypes)
      Returns true if name exists,false otherwise.
      Returns:
      true if name exists
    • checkStereoTypeClass

      public void checkStereoTypeClass(Class<? extends Annotation> clazz, Annotation... annotations)
      Validates that given class obeys stereotype model defined by the specification.
      Parameters:
      clazz - stereotype class
    • checkInterceptorResolverParams

      public void checkInterceptorResolverParams(Annotation... interceptorBindings)
    • checkDecoratorResolverParams

      public void checkDecoratorResolverParams(Set<Type> apiTypes, Annotation... qualifiers)
    • checkQualifiersParams

      public void checkQualifiersParams(Set<Type> apiTypes, Annotation... qualifiers)
    • getDisposalWithGivenAnnotatedMethod

      public <X> Method getDisposalWithGivenAnnotatedMethod(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType, Type beanType, Annotation[] qualifiers)
    • checkInjectionPointForInjectInjectionPoint

      public void checkInjectionPointForInjectInjectionPoint(Class<?> clazz)
      JavaEE components can not inject InjectionPoint.
      Parameters:
      clazz - javaee component class info
      Throws:
      WebBeansConfigurationException - exception if condition is not applied
    • clearCaches

      public void clearCaches()
    • getRepeatableMethod

      public Optional<Method> getRepeatableMethod(Class<?> type)
    • resolveRepeatableMethod

      protected Method resolveRepeatableMethod(Class<?> type)