Top Description Methods
com.google.inject

public Interface PrivateBinder

extends Binder
Known Direct Implementers
com.google.inject.spi.Elements.RecordingBinder
Imports
com.google.inject.binder.AnnotatedElementBuilder

Returns a binder whose configuration information is hidden from its environment by default. See PrivateModule for details.
Author
[email protected] (Jesse Wilson)
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public void
expose(Key<?> key)

Makes the binding for key available to the enclosing environment

public AnnotatedElementBuilder
expose(Class<?> type)

Makes a binding for type available to the enclosing environment.

public AnnotatedElementBuilder
expose(TypeLiteral<?> type)

Makes a binding for type available to the enclosing environment.

public PrivateBinder
skipSources(Class<?>...
library classes that create bindings on behalf of their clients.
classesToSkip
)

Redeclares com.google.inject.Binder.skipSources.

Returns a binder that skips classesToSkip when identify the calling code.
public PrivateBinder
withSource(Object
any object representing the source location and has a concise toString() value
source
)

Redeclares com.google.inject.Binder.withSource.

Returns a binder that uses source as the reference location for configuration errors.
Inherited from com.google.inject.Binder:
addErroraddErroraddErrorbindbindbindbindConstantbindInterceptorbindListenerbindListenerbindScopeconvertToTypescurrentStagedisableCircularProxiesgetMembersInjectorgetMembersInjectorgetProvidergetProvidergetProviderinstallnewPrivateBinderrequestInjectionrequestInjectionrequestStaticInjectionrequireAtInjectOnConstructorsrequireExactBindingAnnotationsrequireExplicitBindingsscanModulesForAnnotatedMethods

Method Detail

exposeback to summary
public void expose(Key<?> key)

Makes the binding for key available to the enclosing environment

exposeback to summary
public AnnotatedElementBuilder expose(Class<?> type)

Makes a binding for type available to the enclosing environment. Use annotatedWith() to expose type with a binding annotation.

exposeback to summary
public AnnotatedElementBuilder expose(TypeLiteral<?> type)

Makes a binding for type available to the enclosing environment. Use annotatedWith() to expose type with a binding annotation.

skipSourcesback to summary
public PrivateBinder skipSources(Class<?>... classesToSkip)

Redeclares com.google.inject.Binder.skipSources.

Doc from com.google.inject.Binder.skipSources.

Returns a binder that skips classesToSkip when identify the calling code. The caller's StackTraceElement is used to locate the source of configuration errors.

Parameters
classesToSkip:Class<?>[]

library classes that create bindings on behalf of their clients.

Returns:PrivateBinder

a binder that shares its configuration with this binder.

Annotations
@Override
withSourceback to summary
public PrivateBinder withSource(Object source)

Redeclares com.google.inject.Binder.withSource.

Doc from com.google.inject.Binder.withSource.

Returns a binder that uses source as the reference location for configuration errors. This is typically a StackTraceElement for .java source but it could any binding source, such as the path to a .properties file.

Parameters
source:Object

any object representing the source location and has a concise toString() value

Returns:PrivateBinder

a binder that shares its configuration with this binder

Annotations
@Override