Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.weld.util;
 
 

Author(s):
Marko Luksa
public class InterceptorBindingSet extends AbstractSet<Annotation> {
    private BeanManagerImpl beanManager;
    private Set<Annotationset = new HashSet<Annotation>();
    public InterceptorBindingSet(BeanManagerImpl beanManager) {
        this. = beanManager;
    }
    @Override
    public boolean add(Annotation annotation) {
        if (contains(annotation)) {
            return false;
        }
        return .add(annotation);
    }
    @Override
    public Iterator<Annotationiterator() {
        return .iterator();
    }
    @Override
    public int size() {
        return .size();
    }
    public boolean contains(Object o) {
        if (o instanceof Annotation) {
            Annotation annotation = (Annotationo;
            MetaAnnotationStore metaAnnotationStore = .getServices().get(MetaAnnotationStore.class);
            InterceptorBindingModel<? extends AnnotationinterceptorBindingModel = metaAnnotationStore.getInterceptorBindingModel(annotation.annotationType());
            for (Annotation containedAnnotation : ) {
                if (interceptorBindingModel.isEqual(annotationcontainedAnnotation)) {
                    return true;
                }
            }
            return false;
        } else {
            return super.contains(o);
        }
    }
New to GrepCode? Check out our FAQ X