本文整理了Java中com.google.inject.spi.Element.applyTo()
方法的一些代码示例,展示了Element.applyTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.applyTo()
方法的具体详情如下:
包路径:com.google.inject.spi.Element
类名称:Element
方法名:applyTo
[英]Writes this module element to the given binder (optional operation).
[中]将此模块元素写入给定的绑定器(可选操作)。
代码示例来源:origin: com.google.inject/guice
@Override
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
}
代码示例来源:origin: com.google.inject/guice
@Override
protected Void visitOther(Element element) {
element.applyTo(binder);
return null;
}
代码示例来源:origin: com.google.inject/guice
@Override
public void applyTo(Binder binder) {
PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
for (Element element : getElements()) {
element.applyTo(privateBinder);
}
getExposedKeys(); // ensure exposedKeysToSources is populated
for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
privateBinder.withSource(entry.getValue()).expose(entry.getKey());
}
}
代码示例来源:origin: com.google.inject/guice
void rewrite(Binder binder, PrivateElements privateElements, Set<Key<?>> keysToSkip) {
PrivateBinder privateBinder =
binder.withSource(privateElements.getSource()).newPrivateBinder();
Set<Key<?>> skippedExposes = Sets.newHashSet();
for (Key<?> key : privateElements.getExposedKeys()) {
if (keysToSkip.remove(key)) {
skippedExposes.add(key);
} else {
privateBinder.withSource(privateElements.getExposedSource(key)).expose(key);
}
}
for (Element element : privateElements.getElements()) {
if (element instanceof Binding && skippedExposes.remove(((Binding) element).getKey())) {
continue;
}
if (element instanceof PrivateElements) {
rewrite(privateBinder, (PrivateElements) element, skippedExposes);
continue;
}
element.applyTo(privateBinder);
}
}
代码示例来源:origin: com.jwebmp.inject/guice
@Override
protected Void visitOther(Element element) {
element.applyTo(binder);
return null;
}
代码示例来源:origin: Nextdoor/bender
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
};
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@Override
protected Void visitOther(Element element) {
element.applyTo(binder);
return null;
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@Override
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
}
代码示例来源:origin: com.atlassian.org.eclipse.sisu/org.eclipse.sisu.inject
@Override
public Void visitOther( final Element element )
{
element.applyTo( binder );
return null;
}
}
代码示例来源:origin: com.jwebmp.inject/guice
@Override
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
}
代码示例来源:origin: com.google/inject
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
};
代码示例来源:origin: org.xbib/guice
@Override
protected Void visitOther(Element element) {
element.applyTo(binder);
return null;
}
代码示例来源:origin: org.xbib/guice
@Override
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.inject
public void configure(Binder binder) {
for (Element element : elements) {
element.applyTo(binder);
}
}
};
代码示例来源:origin: com.atlassian.org.eclipse.sisu/org.eclipse.sisu.inject
@Override
public Void visitOther( final Element element )
{
element.applyTo( binder );
return null;
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@Override
public void applyTo(Binder binder) {
PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
for (Element element : getElements()) {
element.applyTo(privateBinder);
}
getExposedKeys(); // ensure exposedKeysToSources is populated
for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
privateBinder.withSource(entry.getValue()).expose(entry.getKey());
}
}
代码示例来源:origin: com.jwebmp.inject/guice
@Override
public void applyTo(Binder binder) {
PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
for (Element element : getElements()) {
element.applyTo(privateBinder);
}
getExposedKeys(); // ensure exposedKeysToSources is populated
for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
privateBinder.withSource(entry.getValue()).expose(entry.getKey());
}
}
代码示例来源:origin: org.xbib/guice
public void applyTo(Binder binder) {
PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
for (Element element : getElements()) {
element.applyTo(privateBinder);
}
getExposedKeys(); // ensure exposedKeysToSources is populated
for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
privateBinder.withSource(entry.getValue()).expose(entry.getKey());
}
}
代码示例来源:origin: com.google/inject
public void applyTo(Binder binder) {
PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
for (Element element : getElements()) {
element.applyTo(privateBinder);
}
getExposedKeys(); // ensure exposedKeysToSources is populated
for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
privateBinder.withSource(entry.getValue()).expose(entry.getKey());
}
}
代码示例来源:origin: Nextdoor/bender
public void applyTo(Binder binder) {
PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
for (Element element : getElements()) {
element.applyTo(privateBinder);
}
getExposedKeys(); // ensure exposedKeysToSources is populated
for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
privateBinder.withSource(entry.getValue()).expose(entry.getKey());
}
}
内容来源于网络,如有侵权,请联系作者删除!