public interface

PrivateBinder

implements Binder
com.google.inject.PrivateBinder

Class Overview

Returns a binder whose configuration information is hidden from its environment by default. See PrivateModule for details.

Summary

Public Methods
abstract void expose(Key<?> key)
Makes the binding for key available to the enclosing environment
abstract AnnotatedElementBuilder expose(TypeLiteral<?> type)
Makes a binding for type available to the enclosing environment.
abstract AnnotatedElementBuilder expose(Class<?> type)
Makes a binding for type available to the enclosing environment.
abstract PrivateBinder skipSources(Class... classesToSkip)
Returns a binder that skips classesToSkip when identify the calling code.
abstract PrivateBinder withSource(Object source)
Returns a binder that uses source as the reference location for configuration errors.
[Expand]
Inherited Methods
From interface com.google.inject.Binder

Public Methods

public abstract void expose (Key<?> key)

Makes the binding for key available to the enclosing environment

public abstract AnnotatedElementBuilder expose (TypeLiteral<?> type)

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

public abstract AnnotatedElementBuilder expose (Class<?> type)

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

public abstract PrivateBinder skipSources (Class... classesToSkip)

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 library classes that create bindings on behalf of their clients.
Returns
  • a binder that shares its configuration with this binder.

public abstract PrivateBinder withSource (Object source)

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 any object representing the source location and has a concise toString() value
Returns
  • a binder that shares its configuration with this binder