Refine search
@Override public Set<String> apply(DotName name) { ClassInfo annotationClassInfo = index.getClassByName(name); ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (annotationClassInfo != null) { for (DotName annotationName : annotationClassInfo.annotations().keySet()) { builder.add(annotationName.toString()); } } else { try { Class<?> annotationClass = moduleClassLoader.loadClass(name.toString()); for (Annotation annotation : annotationClass.getDeclaredAnnotations()) { builder.add(annotation.annotationType().getName()); } } catch (ClassNotFoundException e) { WeldLogger.DEPLOYMENT_LOGGER.unableToLoadAnnotation(name.toString()); } } return builder.build(); } }
private Set<Annotation> initQualifiers(Set<Annotation> qualifiers) { if (qualifiers.isEmpty()) { return Bindings.DEFAULT_QUALIFIERS; } Set<Annotation> normalized = new HashSet<Annotation>(qualifiers); normalized.remove(Any.Literal.INSTANCE); normalized.remove(Default.Literal.INSTANCE); if (normalized.isEmpty()) { normalized = Bindings.DEFAULT_QUALIFIERS; } else { ImmutableSet.Builder<Annotation> builder = ImmutableSet.builder(); if (normalized.size() == 1) { if (qualifiers.iterator().next().annotationType().equals(Named.class)) { builder.add(Default.Literal.INSTANCE); } } builder.add(Any.Literal.INSTANCE); builder.addAll(qualifiers); normalized = builder.build(); } return normalized; }
private Set<Annotation> initQualifiers(Set<Annotation> qualifiers) { if (qualifiers.isEmpty()) { return Bindings.DEFAULT_QUALIFIERS; } Set<Annotation> normalized = new HashSet<Annotation>(qualifiers); normalized.remove(Any.Literal.INSTANCE); normalized.remove(Default.Literal.INSTANCE); if (normalized.isEmpty()) { normalized = Bindings.DEFAULT_QUALIFIERS; } else { ImmutableSet.Builder<Annotation> builder = ImmutableSet.builder(); if (normalized.size() == 1) { if (qualifiers.iterator().next().annotationType().equals(Named.class)) { builder.add(Default.Literal.INSTANCE); } } builder.add(Any.Literal.INSTANCE); builder.addAll(qualifiers); normalized = builder.build(); } return normalized; }
public static Set<QualifierInstance> of(Set<Annotation> qualifiers, MetaAnnotationStore store) { if (qualifiers.isEmpty()) { return Collections.emptySet(); } final ImmutableSet.Builder<QualifierInstance> ret = ImmutableSet.builder(); for (Annotation a : qualifiers) { ret.add(QualifierInstance.of(a, store)); } return ret.build(); }
@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(); }
public static Set<QualifierInstance> of(Set<Annotation> qualifiers, MetaAnnotationStore store) { if (qualifiers.isEmpty()) { return Collections.emptySet(); } final ImmutableSet.Builder<QualifierInstance> ret = ImmutableSet.builder(); for (Annotation a : qualifiers) { ret.add(QualifierInstance.of(a, store)); } return ret.build(); }
@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(); }
public static Set<QualifierInstance> of(Set<Annotation> qualifiers, MetaAnnotationStore store) { if (qualifiers.isEmpty()) { return Collections.emptySet(); } final ImmutableSet.Builder<QualifierInstance> ret = ImmutableSet.builder(); for (Annotation a : qualifiers) { ret.add(QualifierInstance.of(a, store)); } return ret.build(); }
public static Set<QualifierInstance> of(Set<Annotation> qualifiers, MetaAnnotationStore store) { if (qualifiers.isEmpty()) { return Collections.emptySet(); } final ImmutableSet.Builder<QualifierInstance> ret = ImmutableSet.builder(); for (Annotation a : qualifiers) { ret.add(QualifierInstance.of(a, store)); } return ret.build(); }
public static Set<QualifierInstance> of(Set<Annotation> qualifiers, MetaAnnotationStore store) { if (qualifiers.isEmpty()) { return Collections.emptySet(); } final ImmutableSet.Builder<QualifierInstance> ret = ImmutableSet.builder(); for (Annotation a : qualifiers) { ret.add(QualifierInstance.of(a, store)); } return ret.build(); }
@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(); }
@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(); }
@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(); }
public static Set<QualifierInstance> of(Set<Annotation> qualifiers, MetaAnnotationStore store) { if (qualifiers.isEmpty()) { return Collections.emptySet(); } final ImmutableSet.Builder<QualifierInstance> ret = ImmutableSet.builder(); for (Annotation a : qualifiers) { ret.add(QualifierInstance.of(a, store)); } return ret.build(); }
public WeldSEProvider() { this.containers = ComputingCacheBuilder.newBuilder().setWeakValues().build(new ClassNameToWeldContainer()); ImmutableSet.Builder<String> names = ImmutableSet.builder(); for (Class<?> clazz = getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) { names.add(clazz.getName()); } names.add(Unmanaged.class.getName()); names.add(CDI.class.getName()); this.knownClassNames = names.build(); }
protected void initNonBindingMembers(EnhancedAnnotation<T> annotatedAnnotation) { Set<EnhancedAnnotatedMethod<?, ?>> enhancedMethods = annotatedAnnotation.getMembers(Nonbinding.class); if (enhancedMethods.isEmpty()) { this.nonBindingMembers = Collections.emptySet(); } else { ImmutableSet.Builder<AnnotatedMethod<?>> nonBindingMembers = ImmutableSet.builder(); for (EnhancedAnnotatedMethod<?, ?> method : enhancedMethods) { nonBindingMembers.add(method.slim()); } this.nonBindingMembers = nonBindingMembers.build(); } }
public AbstractCDI() { ImmutableSet.Builder<String> names = ImmutableSet.builder(); for (Class<?> clazz = getClass(); clazz != CDI.class; clazz = clazz.getSuperclass()) { names.add(clazz.getName()); } names.add(Unmanaged.class.getName()); names.add(CompositeCDIProvider.class.getName()); this.knownClassNames = names.build(); this.instanceCache = ComputingCacheBuilder.newBuilder().build(new Function<BeanManagerImpl, WeldInstance<T>>() { @Override public WeldInstance<T> apply(BeanManagerImpl beanManager) { return cast(beanManager.getInstance(beanManager.createCreationalContext(null))); } }); }
@Override public Set<Entry<K, Collection<V>>> entrySet() { ImmutableSet.Builder<Entry<K, Collection<V>>> builder = ImmutableSet.builder(); for (Entry<K, C> entry : getMap().entrySet()) { builder.add(new MultimapEntry<K, Collection<V>>(entry.getKey(), Multimaps.unmodifiableValueCollection(entry.getValue()))); } return builder.build(); }
public WeldSEProvider() { this.containers = ComputingCacheBuilder.newBuilder().setWeakValues().build(new ClassNameToWeldContainer()); ImmutableSet.Builder<String> names = ImmutableSet.builder(); for (Class<?> clazz = getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) { names.add(clazz.getName()); } names.add(Unmanaged.class.getName()); names.add(CDI.class.getName()); names.add(CompositeCDIProvider.class.getName()); this.knownClassNames = names.build(); }
public WeldSEProvider() { this.containers = ComputingCacheBuilder.newBuilder().setWeakValues().build(new ClassNameToWeldContainer()); ImmutableSet.Builder<String> names = ImmutableSet.builder(); for (Class<?> clazz = getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) { names.add(clazz.getName()); } names.add(Unmanaged.class.getName()); names.add(CDI.class.getName()); this.knownClassNames = names.build(); }