com.google.common.collect.SetMultimap#get ( )源码实例Demo

下面列出了com.google.common.collect.SetMultimap#get ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: bundletool   文件: FusingAndroidManifestMerger.java
private static ImmutableMap<BundleModuleName, AndroidManifest> ensureOneManifestPerModule(
    SetMultimap<BundleModuleName, AndroidManifest> manifests) {
  ImmutableMap.Builder<BundleModuleName, AndroidManifest> builder = ImmutableMap.builder();
  for (BundleModuleName moduleName : manifests.keys()) {
    Set<AndroidManifest> moduleManifests = manifests.get(moduleName);
    if (moduleManifests.size() != 1) {
      throw CommandExecutionException.builder()
          .withInternalMessage(
              "Expected exactly one %s module manifest, but found %d.",
              moduleName.getName(), moduleManifests.size())
          .build();
    }
    builder.put(moduleName, Iterables.getOnlyElement(moduleManifests));
  }
  return builder.build();
}
 
@Override
public void process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  Set<? extends Element> componentElements = elementsByAnnotation.get(ProductionComponent.class);

  for (Element element : componentElements) {
    TypeElement componentTypeElement = MoreElements.asType(element);
    ValidationReport<TypeElement> componentReport =
        componentValidator.validate(componentTypeElement);
    componentReport.printMessagesTo(messager);
    if (componentReport.isClean()) {
      ComponentDescriptor componentDescriptor =
          componentDescriptorFactory.forProductionComponent(componentTypeElement);
      BindingGraph bindingGraph = bindingGraphFactory.create(componentDescriptor);
      ValidationReport<BindingGraph> graphReport =
          bindingGraphValidator.validate(bindingGraph);
      graphReport.printMessagesTo(messager);
      if (graphReport.isClean()) {
        try {
          componentGenerator.generate(bindingGraph);
        } catch (SourceFileGenerationException e) {
          e.printMessageTo(messager);
        }
      }
    }
  }
}
 
源代码3 项目: batfish   文件: IpsecUtil.java
/**
 * Returns all {@link IpsecPeerConfigId}s whose local IP is equal to any of the IPs behind
 * destinationIp after NAT
 */
@Nonnull
private static Set<IpsecPeerConfigId> getCandidatePeersBehindNat(
    @Nonnull Ip destinationIp,
    @Nonnull SetMultimap<Ip, IpWildcardSetIpSpace> privateIpsByPublicIp,
    @Nonnull Map<Ip, Set<IpsecPeerConfigId>> localIpsAndIpsecPeers) {
  ImmutableSet.Builder<IpsecPeerConfigId> candidateNeighbors = ImmutableSet.builder();
  Set<IpWildcardSetIpSpace> privateIpsBehindDestIp = privateIpsByPublicIp.get(destinationIp);
  if (privateIpsBehindDestIp == null) {
    return candidateNeighbors.build();
  }
  for (IpWildcardSetIpSpace ipWildcardSetIpSpace : privateIpsBehindDestIp) {
    for (Entry<Ip, Set<IpsecPeerConfigId>> entry : localIpsAndIpsecPeers.entrySet()) {
      if (ipWildcardSetIpSpace.containsIp(entry.getKey(), ImmutableMap.of())) {
        candidateNeighbors.addAll(entry.getValue());
      }
    }
  }
  return candidateNeighbors.build();
}
 
源代码4 项目: dagger2-sample   文件: ComponentProcessingStep.java
@Override
public void process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  Set<? extends Element> componentElements = elementsByAnnotation.get(Component.class);

  for (Element element : componentElements) {
    TypeElement componentTypeElement = MoreElements.asType(element);
    ValidationReport<TypeElement> componentReport =
        componentValidator.validate(componentTypeElement);
    componentReport.printMessagesTo(messager);
    if (componentReport.isClean()) {
      ComponentDescriptor componentDescriptor =
          componentDescriptorFactory.forComponent(componentTypeElement);
      BindingGraph bindingGraph = bindingGraphFactory.create(componentDescriptor);
      ValidationReport<BindingGraph> graphReport =
          bindingGraphValidator.validate(bindingGraph);
      graphReport.printMessagesTo(messager);
      if (graphReport.isClean()) {
        try {
          componentGenerator.generate(bindingGraph);
        } catch (SourceFileGenerationException e) {
          e.printMessageTo(messager);
        }
      }
    }
  }
}
 
源代码5 项目: dagger2-sample   文件: MapKeyProcessingStep.java
@Override
public void process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  for (Element element : elementsByAnnotation.get(MapKey.class)) {
    ValidationReport<Element> mapKeyReport = mapKeyValidator.validate(element);
    mapKeyReport.printMessagesTo(messager);

    if (mapKeyReport.isClean()) {
      MapKey mapkey = element.getAnnotation(MapKey.class);
      if (!mapkey.unwrapValue()) {
        try {
          mapKeyGenerator.generate(element);
        } catch (SourceFileGenerationException e) {
          e.printMessageTo(messager);
        }
      }
    }
  }
}
 
源代码6 项目: buck   文件: AliasConfig.java
/**
 * In a {@link BuckConfig}, an alias can either refer to a fully-qualified build target, or an
 * alias defined earlier in the {@code alias} section. The mapping produced by this method
 * reflects the result of resolving all aliases as values in the {@code alias} section.
 */
private ImmutableSetMultimap<String, UnconfiguredBuildTarget> createAliasToBuildTargetMap(
    ImmutableMap<String, String> rawAliasMap) {
  // We use a LinkedHashMap rather than an ImmutableMap.Builder because we want both (1) order to
  // be preserved, and (2) the ability to inspect the Map while building it up.
  SetMultimap<String, UnconfiguredBuildTarget> aliasToBuildTarget = LinkedHashMultimap.create();
  for (Map.Entry<String, String> aliasEntry : rawAliasMap.entrySet()) {
    String alias = aliasEntry.getKey();
    validateAliasName(alias);

    // Determine whether the mapping is to a build target or to an alias.
    List<String> values = Splitter.on(' ').splitToList(aliasEntry.getValue());
    for (String value : values) {
      Set<UnconfiguredBuildTarget> buildTargets;
      if (isValidAliasName(value)) {
        buildTargets = aliasToBuildTarget.get(value);
        if (buildTargets.isEmpty()) {
          throw new HumanReadableException("No alias for: %s.", value);
        }
      } else if (value.isEmpty()) {
        continue;
      } else {
        // Here we parse the alias values with a BuildTargetParser to be strict. We could be
        // looser and just grab everything between "//" and ":" and assume it's a valid base path.
        buildTargets =
            ImmutableSet.of(
                getDelegate().getUnconfiguredBuildTargetForFullyQualifiedTarget(value));
      }
      aliasToBuildTarget.putAll(alias, buildTargets);
    }
  }
  return ImmutableSetMultimap.copyOf(aliasToBuildTarget);
}
 
源代码7 项目: teammates   文件: DataBundleLogic.java
private void processSessionsAndUpdateRespondents(Collection<FeedbackSessionAttributes> sessions,
        SetMultimap<String, InstructorAttributes> courseInstructorsMap,
        SetMultimap<String, FeedbackQuestionAttributes> sessionQuestionsMap,
        SetMultimap<String, FeedbackResponseAttributes> sessionResponsesMap) {
    for (FeedbackSessionAttributes session : sessions) {
        String sessionKey = makeSessionKey(session.getFeedbackSessionName(), session.getCourseId());

        Set<InstructorAttributes> courseInstructors = courseInstructorsMap.get(session.getCourseId());
        Set<FeedbackQuestionAttributes> sessionQuestions = sessionQuestionsMap.get(sessionKey);
        Set<FeedbackResponseAttributes> sessionResponses = sessionResponsesMap.get(sessionKey);

        updateRespondents(session, courseInstructors, sessionQuestions, sessionResponses);
    }
}
 
源代码8 项目: molgenis   文件: EntityListenersService.java
/** Update all registered listeners of an entity */
void updateEntity(String repoFullName, Entity entity) {
  lock.readLock().lock();
  try {
    verifyRepoRegistered(repoFullName);
    SetMultimap<Object, EntityListener> entityListeners =
        this.entityListenersByRepo.get(repoFullName);
    Set<EntityListener> entityEntityListeners = entityListeners.get(entity.getIdValue());
    entityEntityListeners.forEach(entityListener -> entityListener.postUpdate(entity));
  } finally {
    lock.readLock().unlock();
  }
}
 
源代码9 项目: tasmo   文件: WriteFanoutEventPersistor.java
@Override
public void removeValueFields(VersionedTasmoViewModel model, String className, TenantIdAndCentricId tenantIdAndCentricId, ObjectId instanceId,
    long timestamp) {
    concurrencyStore.removeObjectId(Arrays.asList(new ExistenceUpdate(tenantIdAndCentricId, timestamp, instanceId)));

    SetMultimap<String, TasmoViewModel.FieldNameAndType> eventModel = model.getEventModel();
    Set<String> fieldNames = new HashSet<>();
    for (TasmoViewModel.FieldNameAndType fieldNameAndType : eventModel.get(className)) {
        if (fieldNameAndType.getFieldType() == ModelPathStepType.value) {
            String fieldName = fieldNameAndType.getFieldName();
            fieldNames.add(fieldName);
        }
    }
    eventValueStore.removeObjectId(tenantIdAndCentricId, timestamp, instanceId, fieldNames.toArray(new String[fieldNames.size()]));
}
 
源代码10 项目: teammates   文件: DataBundleLogic.java
private void updateRespondents(FeedbackSessionAttributes session,
        Set<InstructorAttributes> courseInstructors,
        Set<FeedbackQuestionAttributes> sessionQuestions,
        Set<FeedbackResponseAttributes> sessionResponses) {
    String sessionKey = makeSessionKey(session.getFeedbackSessionName(), session.getCourseId());

    SetMultimap<String, String> instructorQuestionKeysMap = HashMultimap.create();
    for (InstructorAttributes instructor : courseInstructors) {
        List<FeedbackQuestionAttributes> questionsForInstructor =
                fqLogic.getFeedbackQuestionsForInstructor(
                        new ArrayList<>(sessionQuestions), session.isCreator(instructor.email));

        List<String> questionKeys = makeQuestionKeys(questionsForInstructor, sessionKey);
        instructorQuestionKeysMap.putAll(instructor.email, questionKeys);
    }

    Set<String> respondingInstructors = new HashSet<>();
    Set<String> respondingStudents = new HashSet<>();

    for (FeedbackResponseAttributes response : sessionResponses) {
        String respondent = response.giver;
        String responseQuestionNumber = response.feedbackQuestionId; // contains question number before injection
        String responseQuestionKey = makeQuestionKey(sessionKey, responseQuestionNumber);

        Set<String> instructorQuestionKeys = instructorQuestionKeysMap.get(respondent);
        if (instructorQuestionKeys.contains(responseQuestionKey)) {
            respondingInstructors.add(respondent);
        } else {
            respondingStudents.add(respondent);
        }
    }

    session.setRespondingInstructorList(respondingInstructors);
    session.setRespondingStudentList(respondingStudents);
}
 
源代码11 项目: j2cl   文件: AptThatWritesNativeJsFile.java
@Override
public Set<Element> process(
    SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  for (Element value : elementsByAnnotation.get(RunApt.class)) {
    TypeElement typeElement = MoreElements.asType(value);
    String packageName = MoreElements.getPackage(typeElement).getQualifiedName().toString();
    writeNativeJsFile(packageName, typeElement.getSimpleName().toString());
  }
  writeJsFile("com.google.j2cl.transpiler.integration.nativeinjectionapt", "NativeClass");
  return ImmutableSet.of();
}
 
源代码12 项目: gef   文件: AbstractAnchor.java
private void updatePositions(Node anchored) {
	SetMultimap<Node, AnchorKey> keys = getKeysByNode();
	if (keys.containsKey(anchored)) {
		Set<AnchorKey> keysCopy = new HashSet<>(keys.get(anchored));
		for (AnchorKey key : keysCopy) {
			updatePosition(key);
		}
	}
}
 
源代码13 项目: tasmo   文件: WriteFanoutEventPersistor.java
@Override
public void removeValueFields(VersionedTasmoViewModel model, String className, TenantIdAndCentricId tenantIdAndCentricId, ObjectId instanceId,
    long timestamp) {
    concurrencyStore.removeObjectId(Arrays.asList(new ExistenceUpdate(tenantIdAndCentricId, timestamp, instanceId)));

    SetMultimap<String, TasmoViewModel.FieldNameAndType> eventModel = model.getEventModel();
    Set<String> fieldNames = new HashSet<>();
    for (TasmoViewModel.FieldNameAndType fieldNameAndType : eventModel.get(className)) {
        if (fieldNameAndType.getFieldType() == ModelPathStepType.value) {
            String fieldName = fieldNameAndType.getFieldName();
            fieldNames.add(fieldName);
        }
    }
    eventValueStore.removeObjectId(tenantIdAndCentricId, timestamp, instanceId, fieldNames.toArray(new String[fieldNames.size()]));
}
 
源代码14 项目: tracing-framework   文件: BaggageImpl.java
/** Get all values from the baggage for a given namespace and key
 * 
 * @param namespace The namespace the key resides in
 * @param key The key to look up within the provided namespace
 * @return The set of all values mapped to that key */
public Set<ByteString> get(ByteString namespace, ByteString key) {
    if (namespace != null || key != null) {
        SetMultimap<ByteString, ByteString> namespaceData = contents.get(namespace);
        if (namespaceData != null) {
            return namespaceData.get(key);
        }
    }
    return Collections.<ByteString> emptySet(); 
}
 
源代码15 项目: paperparcel   文件: OptionsProcessingStep.java
@Override public Set<Element> process(
    SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  Set<Element> processorConfigElements = elementsByAnnotation.get(ProcessorConfig.class);
  if (optionsHolder.isOptionsApplied() || processorConfigElements.size() > 1) {
    messager.printMessage(Diagnostic.Kind.ERROR, ErrorMessages.MULTIPLE_PROCESSOR_CONFIGS);
  } else if (processorConfigElements.size() == 1) {
    Element configElement = processorConfigElements.iterator().next();
    AnnotationMirror config = getAnnotationMirror(configElement, ProcessorConfig.class).get();
    optionsHolder.setOptions(Utils.getModuleOptions(config));
  }
  return ImmutableSet.of();
}
 
源代码16 项目: paperparcel   文件: AdapterProcessingStep.java
@Override public Set<Element> process(
    SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  Set<Element> processorConfigElements = elementsByAnnotation.get(ProcessorConfig.class);
  if (processorConfigElements.size() > 1) {
    messager.printMessage(Diagnostic.Kind.ERROR, ErrorMessages.MULTIPLE_PROCESSOR_CONFIGS);
  } else if (processorConfigElements.size() == 1) {
    Element configElement = processorConfigElements.iterator().next();
    AnnotationMirror config = getAnnotationMirror(configElement, ProcessorConfig.class).get();
    ImmutableList<AnnotationMirror> adapterMirrors = getAnnotationValue(config, "adapters")
        .accept(ANNOTATION_ARRAY_VISITOR, null);
    for (AnnotationMirror adapterMirror : adapterMirrors) {
      TypeElement adapterElement = asType(asDeclared(getAnnotationValue(adapterMirror, "value")
          .accept(Utils.TO_TYPE, null))
          .asElement());
      if (!adapterRegistry.contains(adapterElement)) {
        ValidationReport<TypeElement> report = adapterValidator.validate(adapterElement);
        report.printMessagesTo(messager);
        if (report.isClean()) {
          boolean nullSafe = getAnnotationValue(adapterMirror, "nullSafe")
              .accept(Utils.TO_BOOLEAN, null);
          adapterRegistry.addClassEntry(adapterElement, nullSafe);
        }
      }
    }
  }
  return ImmutableSet.of();
}
 
源代码17 项目: presto   文件: LocalExecutionPlanner.java
@Override
public PhysicalOperation visitIndexSource(IndexSourceNode node, LocalExecutionPlanContext context)
{
    checkState(context.getIndexSourceContext().isPresent(), "Must be in an index source context");
    IndexSourceContext indexSourceContext = context.getIndexSourceContext().get();

    SetMultimap<Symbol, Integer> indexLookupToProbeInput = indexSourceContext.getIndexLookupToProbeInput();
    checkState(indexLookupToProbeInput.keySet().equals(node.getLookupSymbols()));

    // Finalize the symbol lookup layout for the index source
    List<Symbol> lookupSymbolSchema = ImmutableList.copyOf(node.getLookupSymbols());

    // Identify how to remap the probe key Input to match the source index lookup layout
    ImmutableList.Builder<Integer> remappedProbeKeyChannelsBuilder = ImmutableList.builder();
    // Identify overlapping fields that can produce the same lookup symbol.
    // We will filter incoming keys to ensure that overlapping fields will have the same value.
    ImmutableList.Builder<Set<Integer>> overlappingFieldSetsBuilder = ImmutableList.builder();
    for (Symbol lookupSymbol : lookupSymbolSchema) {
        Set<Integer> potentialProbeInputs = indexLookupToProbeInput.get(lookupSymbol);
        checkState(!potentialProbeInputs.isEmpty(), "Must have at least one source from the probe input");
        if (potentialProbeInputs.size() > 1) {
            overlappingFieldSetsBuilder.add(potentialProbeInputs.stream().collect(toImmutableSet()));
        }
        remappedProbeKeyChannelsBuilder.add(Iterables.getFirst(potentialProbeInputs, null));
    }
    List<Set<Integer>> overlappingFieldSets = overlappingFieldSetsBuilder.build();
    List<Integer> remappedProbeKeyChannels = remappedProbeKeyChannelsBuilder.build();
    Function<RecordSet, RecordSet> probeKeyNormalizer = recordSet -> {
        if (!overlappingFieldSets.isEmpty()) {
            recordSet = new FieldSetFilteringRecordSet(metadata, recordSet, overlappingFieldSets);
        }
        return new MappedRecordSet(recordSet, remappedProbeKeyChannels);
    };

    // Declare the input and output schemas for the index and acquire the actual Index
    List<ColumnHandle> lookupSchema = Lists.transform(lookupSymbolSchema, forMap(node.getAssignments()));
    List<ColumnHandle> outputSchema = Lists.transform(node.getOutputSymbols(), forMap(node.getAssignments()));
    ConnectorIndex index = indexManager.getIndex(session, node.getIndexHandle(), lookupSchema, outputSchema);

    OperatorFactory operatorFactory = new IndexSourceOperator.IndexSourceOperatorFactory(context.getNextOperatorId(), node.getId(), index, probeKeyNormalizer);
    return new PhysicalOperation(operatorFactory, makeLayout(node), context, UNGROUPED_EXECUTION);
}
 
源代码18 项目: NullAway   文件: NullAway.java
/**
 * check that all @NonNull fields of the class are properly initialized
 *
 * @param tree the class
 * @param state visitor state
 */
private void checkFieldInitialization(ClassTree tree, VisitorState state) {
  FieldInitEntities entities = collectEntities(tree, state);
  Symbol.ClassSymbol classSymbol = ASTHelpers.getSymbol(tree);
  class2Entities.put(classSymbol, entities);
  // set of all non-null instance fields f such that *some* constructor does not initialize f
  Set<Symbol> notInitializedInConstructors;
  SetMultimap<MethodTree, Symbol> constructorInitInfo;
  if (entities.constructors().isEmpty()) {
    constructorInitInfo = null;
    notInitializedInConstructors = entities.nonnullInstanceFields();
  } else {
    constructorInitInfo = checkConstructorInitialization(entities, state);
    notInitializedInConstructors = ImmutableSet.copyOf(constructorInitInfo.values());
  }
  class2ConstructorUninit.putAll(classSymbol, notInitializedInConstructors);
  Set<Symbol> notInitializedAtAll =
      notAssignedInAnyInitializer(entities, notInitializedInConstructors, state);
  SetMultimap<Element, Element> errorFieldsForInitializer = LinkedHashMultimap.create();
  // non-null if we have a single initializer method
  Symbol.MethodSymbol singleInitializerMethod = null;
  if (entities.instanceInitializerMethods().size() == 1) {
    singleInitializerMethod =
        ASTHelpers.getSymbol(entities.instanceInitializerMethods().iterator().next());
  }
  for (Symbol uninitField : notInitializedAtAll) {
    if (errorBuilder.symbolHasSuppressWarningsAnnotation(
        uninitField, INITIALIZATION_CHECK_NAME)) {
      continue;
    }
    if (singleInitializerMethod != null) {
      // report it on the initializer
      errorFieldsForInitializer.put(singleInitializerMethod, uninitField);
    } else if (constructorInitInfo == null) {
      // report it on the field, except in the case where the class is externalInit and
      // we have no initializer methods
      if (!(isExternalInit(classSymbol) && entities.instanceInitializerMethods().isEmpty())) {
        errorBuilder.reportInitErrorOnField(
            uninitField, state, buildDescription(getTreesInstance(state).getTree(uninitField)));
      }
    } else {
      // report it on each constructor that does not initialize it
      for (MethodTree methodTree : constructorInitInfo.keySet()) {
        Set<Symbol> uninitFieldsForConstructor = constructorInitInfo.get(methodTree);
        if (uninitFieldsForConstructor.contains(uninitField)) {
          errorFieldsForInitializer.put(ASTHelpers.getSymbol(methodTree), uninitField);
        }
      }
    }
  }
  for (Element constructorElement : errorFieldsForInitializer.keySet()) {
    errorBuilder.reportInitializerError(
        (Symbol.MethodSymbol) constructorElement,
        errMsgForInitializer(errorFieldsForInitializer.get(constructorElement), state),
        state,
        buildDescription(getTreesInstance(state).getTree(constructorElement)));
  }
  // For static fields
  Set<Symbol> notInitializedStaticFields = notInitializedStatic(entities, state);
  for (Symbol uninitSField : notInitializedStaticFields) {
    // Always report it on the field for static fields (can't do @SuppressWarnings on a static
    // initialization block
    // anyways).
    errorBuilder.reportInitErrorOnField(
        uninitSField, state, buildDescription(getTreesInstance(state).getTree(uninitSField)));
  }
}
 
源代码19 项目: gef   文件: SetMultimapExpression.java
@Override
public Set<V> get(K key) {
	final SetMultimap<K, V> setMultimap = get();
	return (setMultimap == null) ? EMPTY_SETMULTIMAP.get(key)
			: setMultimap.get(key);
}
 
@Override
public void process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
  // first, check and collect all produces methods
  ImmutableSet.Builder<ExecutableElement> validProducesMethodsBuilder = ImmutableSet.builder();
  for (Element producesElement : elementsByAnnotation.get(Produces.class)) {
    if (producesElement.getKind().equals(METHOD)) {
      ExecutableElement producesMethodElement = (ExecutableElement) producesElement;
      ValidationReport<ExecutableElement> methodReport =
          producesMethodValidator.validate(producesMethodElement);
      methodReport.printMessagesTo(messager);
      if (methodReport.isClean()) {
        validProducesMethodsBuilder.add(producesMethodElement);
      }
    }
  }
  ImmutableSet<ExecutableElement> validProducesMethods = validProducesMethodsBuilder.build();

  // process each module
  for (Element moduleElement :
      Sets.difference(elementsByAnnotation.get(ProducerModule.class),
          processedModuleElements)) {
    if (SuperficialValidation.validateElement(moduleElement)) {
      ValidationReport<TypeElement> report =
          moduleValidator.validate(MoreElements.asType(moduleElement));
      report.printMessagesTo(messager);

      if (report.isClean()) {
        ImmutableSet.Builder<ExecutableElement> moduleProducesMethodsBuilder =
            ImmutableSet.builder();
        List<ExecutableElement> moduleMethods =
            ElementFilter.methodsIn(moduleElement.getEnclosedElements());
        for (ExecutableElement methodElement : moduleMethods) {
          if (isAnnotationPresent(methodElement, Produces.class)) {
            moduleProducesMethodsBuilder.add(methodElement);
          }
        }
        ImmutableSet<ExecutableElement> moduleProducesMethods =
            moduleProducesMethodsBuilder.build();

        if (Sets.difference(moduleProducesMethods, validProducesMethods).isEmpty()) {
          // all of the produces methods in this module are valid!
          // time to generate some factories!
          ImmutableSet<ProductionBinding> bindings = FluentIterable.from(moduleProducesMethods)
              .transform(new Function<ExecutableElement, ProductionBinding>() {
                @Override
                public ProductionBinding apply(ExecutableElement producesMethod) {
                  return productionBindingFactory.forProducesMethod(producesMethod,
                      producesMethod.getEnclosingElement().asType());
                }
              })
              .toSet();

          try {
            for (ProductionBinding binding : bindings) {
              factoryGenerator.generate(binding);
            }
          } catch (SourceFileGenerationException e) {
            e.printMessageTo(messager);
          }
        }
      }

      processedModuleElements.add(moduleElement);
    }
  }
}