Tabnine Logo
Multimap
Code IndexAdd Tabnine to your IDE (free)

How to use
Multimap
in
org.jboss.weld.util.collections

Best Java code snippets using org.jboss.weld.util.collections.Multimap (Showing top 20 results out of 315)

Refine searchRefine arrow

  • SetMultimap
  • EnhancedAnnotatedMethod
  • Multimaps
  • EnhancedAnnotatedType
  • EnhancedAnnotatedTypeImpl
origin: wildfly/wildfly

for (Entry<ResourceRoot, Collection<ComponentDescription>> entry : components.componentDescriptions.entrySet()) {
  BeanDeploymentArchiveImpl bda = bdaMap.get(entry.getKey());
  String id = null;
origin: wildfly/wildfly

private Set<String> getImplicitBeanClasses(Index index, ResourceRoot resourceRoot) {
  Set<String> implicitBeanClasses = new HashSet<String>();
  for (AnnotationType beanDefiningAnnotation : beanDefiningAnnotations) {
    List<AnnotationInstance> annotationInstances = index.getAnnotations(beanDefiningAnnotation.getName());
    for (ClassInfo classInfo : Indices.getAnnotatedClasses(annotationInstances)) {
      implicitBeanClasses.add(Indices.CLASS_INFO_TO_FQCN.apply(classInfo));
    }
  }
  // Make all explicit components into implicit beans so they will support injection
  for(ComponentDescription description : components.componentDescriptions.get(resourceRoot)) {
    if(!components.implicitComponentDescriptions.contains(description)) {
      implicitBeanClasses.add(description.getComponentClassName());
    }
  }
  return implicitBeanClasses;
}
origin: wildfly/wildfly

public Components(DeploymentUnit deploymentUnit, Map<ResourceRoot, Index> indexes) {
  componentDescriptionProcessors = ServiceLoader.load(ComponentDescriptionProcessor.class,
      WildFlySecurityManager.getClassLoaderPrivileged(BeanArchiveProcessor.class));
  for (ComponentDescription component : deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION).getComponentDescriptions()) {
    ResourceRoot resourceRoot = null;
    DotName componentClassName = DotName.createSimple(component.getComponentClassName());
    for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
      final Index index = entry.getValue();
      if (index != null) {
        if (index.getClassByName(componentClassName) != null) {
          resourceRoot = entry.getKey();
          break;
        }
      }
    }
    if (resourceRoot == null) {
      implicitComponentDescriptions.add(component);
    }
    if (resourceRoot == null || isClassesRoot(resourceRoot)) {
      // special handling
      resourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
    }
    componentDescriptions.put(resourceRoot, component);
    // Process component descriptions
    for (ComponentDescriptionProcessor processor : componentDescriptionProcessors) {
      processor.processComponentDescription(resourceRoot, component);
    }
  }
}
origin: weld/core

        declaredFieldsTemp.add(annotatedField);
        for (Annotation annotation : annotatedField.getAnnotations()) {
          declaredAnnotatedFields.put(annotation.annotationType(), annotatedField);
    if ((superclass != null) && (superclass.getJavaClass() != Object.class)) {
      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.declaredAnnotatedFields = Multimaps.unmodifiableMultimap(declaredAnnotatedFields);
        EnhancedAnnotatedMethod<?, ? super T> weldMethod = EnhancedAnnotatedMethodImpl.of(method, this, classTransformer);
        declaredMethodsTemp.add(weldMethod);
        for (Annotation annotation : weldMethod.getAnnotations()) {
          declaredAnnotatedMethods.put(annotation.annotationType(), weldMethod);
          if (weldMethod.getEnhancedParameters(annotationType).size() > 0) {
            declaredMethodsByAnnotatedParameters.put(annotationType, weldMethod);
        declaredAnnotatedMethods.put(annotation.annotationType(), enhancedMethod);
          declaredMethodsByAnnotatedParameters.put(annotationType, enhancedMethod);
this.declaredAnnotatedMethods = Multimaps.unmodifiableMultimap(declaredAnnotatedMethods);
methodsTemp.removeAll(getOverriddenMethods(this, methodsTemp, true));
origin: org.jboss.weld.se/weld-se

/**
 *
 * @param annotatedType
 * @param methods
 * @param skipOverridingBridgeMethods If set to <code>true</code> the returning set will not contain methods overriden by a bridge method
 * @return the set of overriden methods
 */
protected Set<EnhancedAnnotatedMethod<?, ? super T>> getOverriddenMethods(EnhancedAnnotatedType<T> annotatedType,
    Set<EnhancedAnnotatedMethod<?, ? super T>> methods, boolean skipOverridingBridgeMethods) {
  Set<EnhancedAnnotatedMethod<?, ? super T>> overriddenMethods = new HashSet<EnhancedAnnotatedMethod<?, ? super T>>();
  Multimap<MethodSignature, Package> seenMethods = SetMultimap.newSetMultimap();
  for (Class<? super T> clazz = annotatedType.getJavaClass(); clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) {
    for (EnhancedAnnotatedMethod<?, ? super T> method : methods) {
      if (method.getJavaMember().getDeclaringClass().equals(clazz)) {
        if (skipOverridingBridgeMethods && method.getJavaMember().isBridge()) {
          continue;
        }
        if (isOverridden(method, seenMethods)) {
          overriddenMethods.add(method);
        }
        seenMethods.put(method.getSignature(), method.getPackage());
      }
    }
  }
  return immutableSetView(overriddenMethods);
}
origin: weld/core

private static boolean isOverridden(EnhancedAnnotatedMethod<?, ?> method, Multimap<MethodSignature, Package> seenMethods) {
  if (method.isPrivate()) {
    return false;
  } else if (method.isPackagePrivate() && seenMethods.containsKey(method.getSignature())) {
    return seenMethods.get(method.getSignature()).contains(method.getPackage());
  } else {
    return seenMethods.containsKey(method.getSignature());
  }
}
origin: weld/core

/**
 * Merges bean interceptor bindings (including inherited ones) with method interceptor bindings. Method interceptor bindings
 * override bean interceptor bindings. The bean binding map is not modified - a copy is used.
 */
protected Multimap<Class<? extends Annotation>, Annotation> mergeMemberInterceptorBindings(Multimap<Class<? extends Annotation>, Annotation> beanBindings,
    Set<Annotation> methodBindingAnnotations) {
  Multimap<Class<? extends Annotation>, Annotation> mergedBeanBindings = SetMultimap.newSetMultimap(beanBindings);
  Multimap<Class<? extends Annotation>, Annotation> methodBindings = SetMultimap.newSetMultimap();
  for (Annotation methodBinding : methodBindingAnnotations) {
    methodBindings.put(methodBinding.annotationType(), methodBinding);
  }
  for (Class<? extends Annotation> key : methodBindings.keySet()) {
    mergedBeanBindings.replaceValues(key, methodBindings.get(key));
  }
  return mergedBeanBindings;
}
origin: org.jboss.weld.se/weld-se

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);
}
origin: weld/core

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);
}
origin: org.jboss.weld.se/weld-se

/**
 * 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();
}
origin: org.jboss.weld.se/weld-se

/**
 * Gets the abstracted field annotated with a specific annotation type
 * <p/>
 * If the fields map is null, initialize it first
 *
 * @param annotationType The annotation type to match
 * @return A set of matching abstracted fields, null if none are found.
 */
@Override
public Collection<EnhancedAnnotatedField<?, ?>> getEnhancedFields(Class<? extends Annotation> annotationType) {
  if (annotatedFields == null) {
    // Build collection from class hierarchy
    ArrayList<EnhancedAnnotatedField<?, ?>> aggregatedFields = new ArrayList<EnhancedAnnotatedField<?, ?>>(this.declaredAnnotatedFields.get(annotationType));
    if ((superclass != null) && (superclass.getJavaClass() != Object.class)) {
      aggregatedFields.addAll(superclass.getEnhancedFields(annotationType));
    }
    return Collections.unmodifiableCollection(aggregatedFields);
  } else {
    // Return results collected directly from AnnotatedType
    return annotatedFields.get(annotationType);
  }
}
origin: weld/core

protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
  super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager);
  this.interceptorMetadata = initInterceptorMetadata();
  this.serializable = type.isSerializable();
  this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues();
}
origin: org.jboss.weld.se/weld-se

@Override
public boolean isEmpty() {
  return delegate.isEmpty();
}
origin: weld/core

@Override
public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType) {
  return declaredMetaAnnotationMap.containsKey(metaAnnotationType) ? ImmutableSet.copyOf(declaredMetaAnnotationMap.get(metaAnnotationType))
      : Collections.emptySet();
}
origin: org.jboss.weld.se/weld-se

if (!problems.isEmpty()) {
  for (Entry<String, Collection<BeanDeploymentArchive>> entry : problems.entrySet()) {
    WeldSELogger.LOG.beanClassDeployedInMultipleBeanArchives(entry.getKey(), WeldCollections.toMultiRowString(entry.getValue()));
origin: org.jboss.weld.se/weld-se

@Override
public Set<V> uniqueValues() {
  return delegate.uniqueValues();
}
origin: org.jboss.weld.se/weld-se

@Override
public List<V> values() {
  return delegate.values();
}
origin: org.jboss.weld.se/weld-se

@Override
public Set<K> keySet() {
  return delegate.keySet();
}
origin: org.jboss.weld.se/weld-se

@Override
public int size() {
  return delegate.size();
}
origin: weld/core

        declaredFieldsTemp.add(annotatedField);
        for (Annotation annotation : annotatedField.getAnnotations()) {
          declaredAnnotatedFields.put(annotation.annotationType(), annotatedField);
    if ((superclass != null) && (superclass.getJavaClass() != Object.class)) {
      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.declaredAnnotatedFields = Multimaps.unmodifiableMultimap(declaredAnnotatedFields);
        EnhancedAnnotatedMethod<?, ? super T> weldMethod = EnhancedAnnotatedMethodImpl.of(method, this, classTransformer);
        declaredMethodsTemp.add(weldMethod);
        for (Annotation annotation : weldMethod.getAnnotations()) {
          declaredAnnotatedMethods.put(annotation.annotationType(), weldMethod);
          if (weldMethod.getEnhancedParameters(annotationType).size() > 0) {
            declaredMethodsByAnnotatedParameters.put(annotationType, weldMethod);
        declaredAnnotatedMethods.put(annotation.annotationType(), enhancedMethod);
          declaredMethodsByAnnotatedParameters.put(annotationType, enhancedMethod);
this.declaredAnnotatedMethods = Multimaps.unmodifiableMultimap(declaredAnnotatedMethods);
methodsTemp.removeAll(getOverriddenMethods(this, methodsTemp, true));
org.jboss.weld.util.collectionsMultimap

Javadoc

A collection-like structure that maps keys to collections of values.

Most used methods

  • entrySet
    Entry#getValue() always returns an unmodifiable collection. Entry#setValue(Object) operation is not
  • get
    This method never returns null. If no collection of values for a given key exists a new value collec
  • put
  • isEmpty
  • containsKey
  • keySet
  • size
    Unlike Guava'sMultimap#size() this method returns the number of key-value mappings.
  • uniqueValues
  • values
    The list may include the same value multiple times if it occurs in multiple mappings or if the colle
  • replaceValues
    Note that the original collection of values is completely replaced by a new collection which contain

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now