com.google.inject.spi.Element.applyTo()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(299)

本文整理了Java中com.google.inject.spi.Element.applyTo()方法的一些代码示例,展示了Element.applyTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.applyTo()方法的具体详情如下:
包路径:com.google.inject.spi.Element
类名称:Element
方法名:applyTo

Element.applyTo介绍

[英]Writes this module element to the given binder (optional operation).
[中]将此模块元素写入给定的绑定器(可选操作)。

代码示例

代码示例来源:origin: com.google.inject/guice

  1. @Override
  2. public void configure(Binder binder) {
  3. for (Element element : elements) {
  4. element.applyTo(binder);
  5. }
  6. }
  7. }

代码示例来源:origin: com.google.inject/guice

  1. @Override
  2. protected Void visitOther(Element element) {
  3. element.applyTo(binder);
  4. return null;
  5. }

代码示例来源:origin: com.google.inject/guice

  1. @Override
  2. public void applyTo(Binder binder) {
  3. PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
  4. for (Element element : getElements()) {
  5. element.applyTo(privateBinder);
  6. }
  7. getExposedKeys(); // ensure exposedKeysToSources is populated
  8. for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
  9. privateBinder.withSource(entry.getValue()).expose(entry.getKey());
  10. }
  11. }

代码示例来源:origin: com.google.inject/guice

  1. void rewrite(Binder binder, PrivateElements privateElements, Set<Key<?>> keysToSkip) {
  2. PrivateBinder privateBinder =
  3. binder.withSource(privateElements.getSource()).newPrivateBinder();
  4. Set<Key<?>> skippedExposes = Sets.newHashSet();
  5. for (Key<?> key : privateElements.getExposedKeys()) {
  6. if (keysToSkip.remove(key)) {
  7. skippedExposes.add(key);
  8. } else {
  9. privateBinder.withSource(privateElements.getExposedSource(key)).expose(key);
  10. }
  11. }
  12. for (Element element : privateElements.getElements()) {
  13. if (element instanceof Binding && skippedExposes.remove(((Binding) element).getKey())) {
  14. continue;
  15. }
  16. if (element instanceof PrivateElements) {
  17. rewrite(privateBinder, (PrivateElements) element, skippedExposes);
  18. continue;
  19. }
  20. element.applyTo(privateBinder);
  21. }
  22. }

代码示例来源:origin: com.jwebmp.inject/guice

  1. @Override
  2. protected Void visitOther(Element element) {
  3. element.applyTo(binder);
  4. return null;
  5. }

代码示例来源:origin: Nextdoor/bender

  1. public void configure(Binder binder) {
  2. for (Element element : elements) {
  3. element.applyTo(binder);
  4. }
  5. }
  6. };

代码示例来源:origin: org.sonatype.sisu/sisu-guice

  1. @Override
  2. protected Void visitOther(Element element) {
  3. element.applyTo(binder);
  4. return null;
  5. }

代码示例来源:origin: org.sonatype.sisu/sisu-guice

  1. @Override
  2. public void configure(Binder binder) {
  3. for (Element element : elements) {
  4. element.applyTo(binder);
  5. }
  6. }
  7. }

代码示例来源:origin: com.atlassian.org.eclipse.sisu/org.eclipse.sisu.inject

  1. @Override
  2. public Void visitOther( final Element element )
  3. {
  4. element.applyTo( binder );
  5. return null;
  6. }
  7. }

代码示例来源:origin: com.jwebmp.inject/guice

  1. @Override
  2. public void configure(Binder binder) {
  3. for (Element element : elements) {
  4. element.applyTo(binder);
  5. }
  6. }
  7. }

代码示例来源:origin: com.google/inject

  1. public void configure(Binder binder) {
  2. for (Element element : elements) {
  3. element.applyTo(binder);
  4. }
  5. }
  6. };

代码示例来源:origin: org.xbib/guice

  1. @Override
  2. protected Void visitOther(Element element) {
  3. element.applyTo(binder);
  4. return null;
  5. }

代码示例来源:origin: org.xbib/guice

  1. @Override
  2. public void configure(Binder binder) {
  3. for (Element element : elements) {
  4. element.applyTo(binder);
  5. }
  6. }
  7. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.inject

  1. public void configure(Binder binder) {
  2. for (Element element : elements) {
  3. element.applyTo(binder);
  4. }
  5. }
  6. };

代码示例来源:origin: com.atlassian.org.eclipse.sisu/org.eclipse.sisu.inject

  1. @Override
  2. public Void visitOther( final Element element )
  3. {
  4. element.applyTo( binder );
  5. return null;
  6. }

代码示例来源:origin: org.sonatype.sisu/sisu-guice

  1. @Override
  2. public void applyTo(Binder binder) {
  3. PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
  4. for (Element element : getElements()) {
  5. element.applyTo(privateBinder);
  6. }
  7. getExposedKeys(); // ensure exposedKeysToSources is populated
  8. for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
  9. privateBinder.withSource(entry.getValue()).expose(entry.getKey());
  10. }
  11. }

代码示例来源:origin: com.jwebmp.inject/guice

  1. @Override
  2. public void applyTo(Binder binder) {
  3. PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
  4. for (Element element : getElements()) {
  5. element.applyTo(privateBinder);
  6. }
  7. getExposedKeys(); // ensure exposedKeysToSources is populated
  8. for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
  9. privateBinder.withSource(entry.getValue()).expose(entry.getKey());
  10. }
  11. }

代码示例来源:origin: org.xbib/guice

  1. public void applyTo(Binder binder) {
  2. PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
  3. for (Element element : getElements()) {
  4. element.applyTo(privateBinder);
  5. }
  6. getExposedKeys(); // ensure exposedKeysToSources is populated
  7. for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
  8. privateBinder.withSource(entry.getValue()).expose(entry.getKey());
  9. }
  10. }

代码示例来源:origin: com.google/inject

  1. public void applyTo(Binder binder) {
  2. PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
  3. for (Element element : getElements()) {
  4. element.applyTo(privateBinder);
  5. }
  6. getExposedKeys(); // ensure exposedKeysToSources is populated
  7. for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
  8. privateBinder.withSource(entry.getValue()).expose(entry.getKey());
  9. }
  10. }

代码示例来源:origin: Nextdoor/bender

  1. public void applyTo(Binder binder) {
  2. PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
  3. for (Element element : getElements()) {
  4. element.applyTo(privateBinder);
  5. }
  6. getExposedKeys(); // ensure exposedKeysToSources is populated
  7. for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
  8. privateBinder.withSource(entry.getValue()).expose(entry.getKey());
  9. }
  10. }

相关文章