}
else
{
typeAnns = clazz.getDeclaredAnnotations();
}
AnnotationManager annotationManager = component.getWebBeansContext().getAnnotationManager();
if (annotationManager.hasInterceptorBindingMetaAnnotation(typeAnns))
{
anns = annotationManager.getInterceptorBindingMetaAnnotations(typeAnns);
for (Annotation ann : anns)
{
bindingTypeSet.add(ann);
}
}
// check for stereotypes _explicitly_ declared on the bean class (not
// inherited)
Annotation[] stereoTypes =
annotationManager.getStereotypeMetaAnnotations(typeAnns);
for (Annotation stero : stereoTypes)
{
if (annotationManager.hasInterceptorBindingMetaAnnotation(stero.annotationType().getDeclaredAnnotations()))
{
Annotation[] steroInterceptorBindings = annotationManager.getInterceptorBindingMetaAnnotations(
stero.annotationType().getDeclaredAnnotations());
for (Annotation ann : steroInterceptorBindings)
{
bindingTypeSet.add(ann);
}
}
}
// Look for inherited binding types, keeping in mind that
// IBeanInheritedMetaData knows nothing of the transitive
// relationships of Interceptor Bindings or Stereotypes. We must resolve
// these here.
IBeanInheritedMetaData metadata = component.getInheritedMetaData();
if (metadata != null)
{
Set<Annotation> inheritedBindingTypes = metadata.getInheritedInterceptorBindings();
if (!inheritedBindingTypes.isEmpty())
{
Annotation[] inheritedAnns = new Annotation[inheritedBindingTypes.size()];
inheritedAnns = inheritedBindingTypes.toArray(inheritedAnns);
anns = annotationManager.getInterceptorBindingMetaAnnotations(inheritedAnns);
bindingTypeSet.addAll(Arrays.asList(anns));
}
// Retrieve inherited stereotypes, check for meta-annotations, and
// find the ultimate set of bindings
Set<Annotation> inheritedStereotypes = metadata.getInheritedStereoTypes();
if (!inheritedStereotypes.isEmpty())
{
// We need AnnotationUtil to resolve the transitive relationship
// of stereotypes we've found
Annotation[] inherited = new Annotation[inheritedStereotypes.size()];
inherited = inheritedStereotypes.toArray(inherited);
Annotation[] transitiveStereotypes = annotationManager.getStereotypeMetaAnnotations(inherited);
for (Annotation stereo : transitiveStereotypes)
{
if (annotationManager.hasInterceptorBindingMetaAnnotation(stereo.annotationType().getDeclaredAnnotations()))
{
Annotation[] steroInterceptorBindings =
annotationManager.getInterceptorBindingMetaAnnotations(stereo.annotationType().getDeclaredAnnotations());
for (Annotation ann : steroInterceptorBindings)
{
bindingTypeSet.add(ann);
}
}