Java Code Examples for com.google.inject.spi.Element#applyTo()
The following examples show how to use
com.google.inject.spi.Element#applyTo() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Scoper.java From ProjectAres with GNU Affero General Public License v3.0 | 6 votes |
@Override public Void visit(ExposedBinding<? extends T> binding) { final PrivateBinder privateBinder = this.binder.newPrivateBinder(); final Scoper scoper = new Scoper(privateBinder, scoping); for(Element element : binding.getPrivateElements().getElements()) { if(element instanceof Binding) { ((Binding) element).acceptTargetVisitor(scoper); } else { element.applyTo(privateBinder); } } for(Key key : binding.getPrivateElements().getExposedKeys()) { privateBinder.expose(key); } return null; }
Example 2
Source File: SecurityModule.java From seed with Mozilla Public License 2.0 | 6 votes |
@Override protected void configure() { for (Element element : privateElements.getElements()) { if (element instanceof Binding && isExcluded(((Binding<?>) element).getKey())) { continue; } element.applyTo(binder()); } for (Key<?> exposedKey : privateElements.getExposedKeys()) { if (isExcluded(exposedKey)) { continue; } expose(exposedKey); } }
Example 3
Source File: Binders.java From ProjectAres with GNU Affero General Public License v3.0 | 5 votes |
default void installIn(Scoping scoping, Module... modules) { final Scoper scoper = new Scoper(this, scoping); for(Element element : Elements.getElements(modules)) { if(element instanceof Binding) { ((Binding) element).acceptTargetVisitor(scoper); } else { element.applyTo(this); } } }