protected Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedParameterMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) { Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> result = SetMultimap.newSetMultimap(); for (EnhancedAnnotatedMethod<?, ? super T> method : effectiveMethods) { for (Class<? extends Annotation> annotation : MAPPED_METHOD_PARAMETER_ANNOTATIONS) { if (!method.getEnhancedParameters(annotation).isEmpty()) { result.put(annotation, method); } } } return Multimaps.unmodifiableMultimap(result); }
/** * Returns unmodifiable collections. Moreover, it does not trigger initialization of a new value collection (i.e. when no collection of values for a * given key exists). */ @Override public Collection<V> get(K key) { if (delegate.containsKey(key)) { return unmodifiableValueCollection(delegate.get(key)); } return Collections.emptyList(); }
declaredFieldsTemp.add(annotatedField); for (Annotation annotation : annotatedField.getAnnotations()) { declaredAnnotatedFields.put(annotation.annotationType(), annotatedField); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); annotatedFields.put(annotation.annotationType(), weldField); if (annotatedField.getDeclaringType().getJavaClass().equals(javaClass)) { declaredAnnotatedFields.put(annotation.annotationType(), weldField); this.annotatedFields = Multimaps.unmodifiableMultimap(annotatedFields); this.declaredFields = new HashSet<EnhancedAnnotatedField<?, ? super T>>(declaredFieldsTemp); this.declaredAnnotatedFields = Multimaps.unmodifiableMultimap(declaredAnnotatedFields); EnhancedAnnotatedMethod<?, ? super T> weldMethod = EnhancedAnnotatedMethodImpl.of(method, this, classTransformer); declaredMethodsTemp.add(weldMethod); for (Annotation annotation : weldMethod.getAnnotations()) { if (weldMethod.getEnhancedParameters(annotationType).size() > 0) { this.declaredAnnotatedMethods = Multimaps.unmodifiableMultimap(declaredAnnotatedMethods); this.declaredMethodsByAnnotatedParameters = Multimaps.unmodifiableMultimap(declaredMethodsByAnnotatedParameters); SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp);
this.delegate = annotated; if (annotated instanceof AnnotatedType<?>) { this.rawType = Reflections.<AnnotatedType<T>>cast(annotated).getJavaClass(); } else { this.rawType = Reflections.getRawType(annotated.getBaseType()); SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(metaAnnotationMap, annotationMap.values(), classTransformer, false); this.metaAnnotationMap = Multimaps.unmodifiableMultimap(metaAnnotationMap);
return Multimaps.emptyMultimap(); SetMultimap<String, BeanDeploymentArchive> problems = SetMultimap.newSetMultimap(); List<BeanDeploymentArchive> bdas = ImmutableList.of(first, second); for (String beanClass : intersection) { problems.putAll(beanClass, bdas); SetMultimap<String, BeanDeploymentArchive> beanClassOccurrences = SetMultimap.newSetMultimap(); for (BeanDeploymentArchive beanArchive : beanArchives) { for (String beanClass : beanArchive.getBeanClasses()) {
protected Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) { Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> result = SetMultimap.newSetMultimap(); for (EnhancedAnnotatedMethod<?, ? super T> method : effectiveMethods) { for (Class<? extends Annotation> annotation : MAPPED_METHOD_ANNOTATIONS) { if (method.isAnnotationPresent(annotation)) { result.put(annotation, method); } } } return Multimaps.unmodifiableMultimap(result); }
@Override public Set<Entry<K, Collection<V>>> entrySet() { ImmutableSet.Builder<Entry<K, Collection<V>>> builder = ImmutableSet.builder(); for (Entry<K, C> entry : map.entrySet()) { builder.add(new MultimapEntry<K, Collection<V>>(entry.getKey(), Multimaps.unmodifiableValueCollection(entry.getValue()))); } return builder.build(); }
declaredFieldsTemp.add(annotatedField); for (Annotation annotation : annotatedField.getAnnotations()) { declaredAnnotatedFields.put(annotation.annotationType(), annotatedField); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); annotatedFields.put(annotation.annotationType(), weldField); if (annotatedField.getDeclaringType().getJavaClass().equals(javaClass)) { declaredAnnotatedFields.put(annotation.annotationType(), weldField); this.annotatedFields = Multimaps.unmodifiableMultimap(annotatedFields); this.declaredFields = new HashSet<EnhancedAnnotatedField<?, ? super T>>(declaredFieldsTemp); this.declaredAnnotatedFields = Multimaps.unmodifiableMultimap(declaredAnnotatedFields); EnhancedAnnotatedMethod<?, ? super T> weldMethod = EnhancedAnnotatedMethodImpl.of(method, this, classTransformer); declaredMethodsTemp.add(weldMethod); for (Annotation annotation : weldMethod.getAnnotations()) { if (weldMethod.getEnhancedParameters(annotationType).size() > 0) { this.declaredAnnotatedMethods = Multimaps.unmodifiableMultimap(declaredAnnotatedMethods); this.declaredMethodsByAnnotatedParameters = Multimaps.unmodifiableMultimap(declaredMethodsByAnnotatedParameters); SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp);
this.delegate = annotated; if (annotated instanceof AnnotatedType<?>) { this.rawType = Reflections.<AnnotatedType<T>>cast(annotated).getJavaClass(); } else { this.rawType = Reflections.getRawType(annotated.getBaseType()); SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(metaAnnotationMap, annotationMap.values(), classTransformer, false); this.metaAnnotationMap = Multimaps.unmodifiableMultimap(metaAnnotationMap);
return Multimaps.emptyMultimap(); SetMultimap<String, BeanDeploymentArchive> problems = SetMultimap.newSetMultimap(); List<BeanDeploymentArchive> bdas = ImmutableList.of(first, second); for (String beanClass : intersection) { problems.putAll(beanClass, bdas); SetMultimap<String, BeanDeploymentArchive> beanClassOccurrences = SetMultimap.newSetMultimap(); for (BeanDeploymentArchive beanArchive : beanArchives) { for (String beanClass : beanArchive.getBeanClasses()) {
protected Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) { Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> result = SetMultimap.newSetMultimap(); for (EnhancedAnnotatedMethod<?, ? super T> method : effectiveMethods) { for (Class<? extends Annotation> annotation : MAPPED_METHOD_ANNOTATIONS) { if (method.isAnnotationPresent(annotation)) { result.put(annotation, method); } } } return Multimaps.unmodifiableMultimap(result); }
@Override public Set<Entry<K, Collection<V>>> entrySet() { ImmutableSet.Builder<Entry<K, Collection<V>>> builder = ImmutableSet.builder(); for (Entry<K, C> entry : map.entrySet()) { builder.add(new MultimapEntry<K, Collection<V>>(entry.getKey(), Multimaps.unmodifiableValueCollection(entry.getValue()))); } return builder.build(); }
declaredFieldsTemp.add(annotatedField); for (Annotation annotation : annotatedField.getAnnotations()) { declaredAnnotatedFields.put(annotation.annotationType(), annotatedField); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); annotatedFields.put(annotation.annotationType(), weldField); if (annotatedField.getDeclaringType().getJavaClass().equals(javaClass)) { declaredAnnotatedFields.put(annotation.annotationType(), weldField); this.annotatedFields = Multimaps.unmodifiableMultimap(annotatedFields); this.declaredFields = new HashSet<EnhancedAnnotatedField<?, ? super T>>(declaredFieldsTemp); this.declaredAnnotatedFields = Multimaps.unmodifiableMultimap(declaredAnnotatedFields); EnhancedAnnotatedMethod<?, ? super T> weldMethod = EnhancedAnnotatedMethodImpl.of(method, this, classTransformer); declaredMethodsTemp.add(weldMethod); for (Annotation annotation : weldMethod.getAnnotations()) { if (weldMethod.getEnhancedParameters(annotationType).size() > 0) { this.declaredAnnotatedMethods = Multimaps.unmodifiableMultimap(declaredAnnotatedMethods); this.declaredMethodsByAnnotatedParameters = Multimaps.unmodifiableMultimap(declaredMethodsByAnnotatedParameters); SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp);
this.delegate = annotated; if (annotated instanceof AnnotatedType<?>) { this.rawType = Reflections.<AnnotatedType<T>>cast(annotated).getJavaClass(); } else { this.rawType = Reflections.getRawType(annotated.getBaseType()); SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(metaAnnotationMap, annotationMap.values(), classTransformer, false); this.metaAnnotationMap = Multimaps.unmodifiableMultimap(metaAnnotationMap);
return Multimaps.emptyMultimap(); SetMultimap<String, BeanDeploymentArchive> problems = SetMultimap.newSetMultimap(); List<BeanDeploymentArchive> bdas = ImmutableList.of(first, second); for (String beanClass : intersection) { problems.putAll(beanClass, bdas); SetMultimap<String, BeanDeploymentArchive> beanClassOccurrences = SetMultimap.newSetMultimap(); for (BeanDeploymentArchive beanArchive : beanArchives) { for (String beanClass : beanArchive.getBeanClasses()) {
protected Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedParameterMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) { Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> result = SetMultimap.newSetMultimap(); for (EnhancedAnnotatedMethod<?, ? super T> method : effectiveMethods) { for (Class<? extends Annotation> annotation : MAPPED_METHOD_PARAMETER_ANNOTATIONS) { if (!method.getEnhancedParameters(annotation).isEmpty()) { result.put(annotation, method); } } } return Multimaps.unmodifiableMultimap(result); }
protected Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> buildAnnotatedMethodMultimap(Set<EnhancedAnnotatedMethod<?, ? super T>> effectiveMethods) { Multimap<Class<? extends Annotation>, EnhancedAnnotatedMethod<?, ? super T>> result = SetMultimap.newSetMultimap(); for (EnhancedAnnotatedMethod<?, ? super T> method : effectiveMethods) { for (Class<? extends Annotation> annotation : MAPPED_METHOD_ANNOTATIONS) { if (method.isAnnotationPresent(annotation)) { result.put(annotation, method); } } } return Multimaps.unmodifiableMultimap(result); }
/** * Returns unmodifiable collections. Moreover, it does not trigger initialization of a new value collection (i.e. when no collection of values for a * given key exists). */ @Override public Collection<V> get(K key) { if (delegate.containsKey(key)) { return unmodifiableValueCollection(delegate.get(key)); } return Collections.emptyList(); }
@Override public Set<Entry<K, Collection<V>>> entrySet() { ImmutableSet.Builder<Entry<K, Collection<V>>> builder = ImmutableSet.builder(); for (Entry<K, C> entry : map.entrySet()) { builder.add(new MultimapEntry<K, Collection<V>>(entry.getKey(), Multimaps.unmodifiableValueCollection(entry.getValue()))); } return builder.build(); }
declaredFieldsTemp.add(annotatedField); for (Annotation annotation : annotatedField.getAnnotations()) { declaredAnnotatedFields.put(annotation.annotationType(), annotatedField); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); annotatedFields.put(annotation.annotationType(), weldField); if (annotatedField.getDeclaringType().getJavaClass().equals(javaClass)) { declaredAnnotatedFields.put(annotation.annotationType(), weldField); this.annotatedFields = Multimaps.unmodifiableMultimap(annotatedFields); this.declaredFields = new HashSet<EnhancedAnnotatedField<?, ? super T>>(declaredFieldsTemp); this.declaredAnnotatedFields = Multimaps.unmodifiableMultimap(declaredAnnotatedFields); EnhancedAnnotatedMethod<?, ? super T> weldMethod = EnhancedAnnotatedMethodImpl.of(method, this, classTransformer); declaredMethodsTemp.add(weldMethod); for (Annotation annotation : weldMethod.getAnnotations()) { if (weldMethod.getEnhancedParameters(annotationType).size() > 0) { this.declaredAnnotatedMethods = Multimaps.unmodifiableMultimap(declaredAnnotatedMethods); this.declaredMethodsByAnnotatedParameters = Multimaps.unmodifiableMultimap(declaredMethodsByAnnotatedParameters); SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp);