Package com.google.inject
Interface PrivateBinder
-
- All Superinterfaces:
Binder
public interface PrivateBinder extends Binder
Returns a binder whose configuration information is hidden from its environment by default. SeePrivateModule
for details.- Since:
- 2.0
- Author:
- jessewilson@google.com (Jesse Wilson)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
expose(Key<?> key)
Makes the binding forkey
available to the enclosing environmentAnnotatedElementBuilder
expose(TypeLiteral<?> type)
Makes a binding fortype
available to the enclosing environment.AnnotatedElementBuilder
expose(Class<?> type)
Makes a binding fortype
available to the enclosing environment.PrivateBinder
skipSources(Class<?>... classesToSkip)
Returns a binder that skipsclassesToSkip
when identify the calling code.PrivateBinder
withSource(Object source)
Returns a binder that usessource
as the reference location for configuration errors.-
Methods inherited from interface com.google.inject.Binder
addError, addError, addError, bind, bind, bind, bindConstant, bindInterceptor, bindListener, bindListener, bindScope, convertToTypes, currentStage, disableCircularProxies, getMembersInjector, getMembersInjector, getProvider, getProvider, getProvider, install, newPrivateBinder, requestInjection, requestInjection, requestStaticInjection, requireAtInjectOnConstructors, requireExactBindingAnnotations, requireExplicitBindings, scanModulesForAnnotatedMethods
-
-
-
-
Method Detail
-
expose
void expose(Key<?> key)
Makes the binding forkey
available to the enclosing environment
-
expose
AnnotatedElementBuilder expose(Class<?> type)
Makes a binding fortype
available to the enclosing environment. UseannotatedWith()
to exposetype
with a binding annotation.
-
expose
AnnotatedElementBuilder expose(TypeLiteral<?> type)
Makes a binding fortype
available to the enclosing environment. UseannotatedWith()
to exposetype
with a binding annotation.
-
withSource
PrivateBinder withSource(Object source)
Description copied from interface:Binder
Returns a binder that usessource
as the reference location for configuration errors. This is typically aStackTraceElement
for.java
source but it could any binding source, such as the path to a.properties
file.- Specified by:
withSource
in interfaceBinder
- Parameters:
source
- any object representing the source location and has a concisetoString()
value- Returns:
- a binder that shares its configuration with this binder
-
skipSources
PrivateBinder skipSources(Class<?>... classesToSkip)
Description copied from interface:Binder
Returns a binder that skipsclassesToSkip
when identify the calling code. The caller'sStackTraceElement
is used to locate the source of configuration errors.- Specified by:
skipSources
in interfaceBinder
- Parameters:
classesToSkip
- library classes that create bindings on behalf of their clients.- Returns:
- a binder that shares its configuration with this binder.
-
-