private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings, MetaAnnotationStore metaAnnotationStore) { for (Annotation annotation : interceptorBindings) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) { for (Annotation binding : flattenInterceptorBindings) { if (binding.annotationType().equals(annotationType) && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) { if (clazz != null) { throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz)); } else { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation); } } } } flattenInterceptorBindings.add(annotation); } }
private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings, MetaAnnotationStore metaAnnotationStore) { for (Annotation annotation : interceptorBindings) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) { for (Annotation binding : flattenInterceptorBindings) { if (binding.annotationType().equals(annotationType) && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) { if (clazz != null) { throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz)); } else { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation); } } } } flattenInterceptorBindings.add(annotation); } }
private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings, MetaAnnotationStore metaAnnotationStore) { for (Annotation annotation : interceptorBindings) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) { for (Annotation binding : flattenInterceptorBindings) { if (binding.annotationType().equals(annotationType) && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) { if (clazz != null) { throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz)); } else { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation); } } } } flattenInterceptorBindings.add(annotation); } }
private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings, MetaAnnotationStore metaAnnotationStore) { for (Annotation annotation : interceptorBindings) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) { for (Annotation binding : flattenInterceptorBindings) { if (binding.annotationType().equals(annotationType) && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) { if (clazz != null) { throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz)); } else { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation); } } } } flattenInterceptorBindings.add(annotation); } }
private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings, MetaAnnotationStore metaAnnotationStore) { for (Annotation annotation : interceptorBindings) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) { for (Annotation binding : flattenInterceptorBindings) { if (binding.annotationType().equals(annotationType) && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) { if (clazz != null) { throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz)); } else { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation); } } } } flattenInterceptorBindings.add(annotation); } }
@Override protected void checkQualifier(Annotation qualifier, QualifierInstance qualifierInstance, Class<? extends Annotation> annotationType) { if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) { throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier); } if (annotationTypes.contains(annotationType)) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifier); } }
@Override protected void checkQualifier(Annotation qualifier,final QualifierInstance qualifierInstance, Class<? extends Annotation> annotationType) { if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) { throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier); } if (qualifierInstances.contains(qualifierInstance)) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifierInstance); } }
@Override protected void checkQualifier(Annotation qualifier,final QualifierInstance qualifierInstance, Class<? extends Annotation> annotationType) { if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) { throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier); } if (qualifierInstances.contains(qualifierInstance)) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifierInstance); } }
@Override protected void checkQualifier(Annotation qualifier,final QualifierInstance qualifierInstance, Class<? extends Annotation> annotationType) { if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) { throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier); } if (qualifierInstances.contains(qualifierInstance)) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifierInstance); } }
@Override protected void checkQualifier(Annotation qualifier,final QualifierInstance qualifierInstance, Class<? extends Annotation> annotationType) { if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) { throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier); } if (qualifierInstances.contains(qualifierInstance)) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifierInstance); } }
@Override protected void checkQualifier(Annotation qualifier,final QualifierInstance qualifierInstance, Class<? extends Annotation> annotationType) { if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) { throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier); } if (qualifierInstances.contains(qualifierInstance)) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifierInstance); } }
/** * Extracts a flat set of interception bindings from a given set of interceptor bindings. * * @param addTopLevelInterceptorBindings add top level interceptor bindings to the result set. * @param addInheritedInterceptorBindings add inherited level interceptor bindings to the result set. * @return */ public static Set<Annotation> flattenInterceptorBindings(BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings, boolean addInheritedInterceptorBindings) { Set<Annotation> flattenInterceptorBindings = new InterceptorBindingSet(beanManager); if (addTopLevelInterceptorBindings) { for (Annotation annotation : annotations) { boolean added = flattenInterceptorBindings.add(annotation); if (!added) { throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotations); } } } if (addInheritedInterceptorBindings) { for (Annotation annotation : annotations) { addInheritedInterceptorBindings(annotation.annotationType(), beanManager.getServices().get(MetaAnnotationStore.class), flattenInterceptorBindings); } } return flattenInterceptorBindings; }