Top Fields Constructors Methods
com.google.inject.internal

public final Class PrivateElementsImpl

extends Object
implements PrivateElements
Class Inheritance
All Implemented Interfaces
com.google.inject.spi.PrivateElements, com.google.inject.spi.Element
Static Imports
com.google.common.base.Preconditions.checkArgument, .Preconditions.checkNotNull, .Preconditions.checkState

Author
[email protected] (Jesse Wilson)

Field Summary

Modifier and TypeField and Description
private ImmutableList<Element>
elements

lazily instantiated

private List<Element>
private ImmutableMap<Key<?>, Object>
exposedKeysToSources

lazily instantiated

private List<ExposureBuilder<?>>
private Injector
private final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
acceptVisitor(ElementVisitor<T>
to call back on
visitor
)

Implements com.google.inject.spi.Element.acceptVisitor.

Accepts an element visitor.
public void
addExposureBuilder(ExposureBuilder<?> exposureBuilder)

public void
applyTo(Binder
to apply configuration element to
binder
)

Implements com.google.inject.spi.Element.applyTo.

Writes this module element to the given binder (optional operation).
public List<Element>
getElements()

Implements com.google.inject.spi.PrivateElements.getElements.

Returns the configuration information in this private environment.
public List<Element>
public Set<Key<?>>
getExposedKeys()

Implements com.google.inject.spi.PrivateElements.getExposedKeys.

Returns the unique exposed keys for these private elements.
public Object
getExposedSource(Key<?>
one of the keys exposed by this module.
key
)

Implements com.google.inject.spi.PrivateElements.getExposedSource.

Returns an arbitrary object containing information about the "place" where this key was exposed.
public Injector
getInjector()

Implements com.google.inject.spi.PrivateElements.getInjector.

Returns the child injector that hosts these private elements, or null if the elements haven't been used to create an injector.
public Object
getSource()

Implements com.google.inject.spi.Element.getSource.

Returns an arbitrary object containing information about the "place" where this element was configured.
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

elementsback to summary
private ImmutableList<Element> elements

lazily instantiated

elementsMutableback to summary
private List<Element> elementsMutable
exposedKeysToSourcesback to summary
private ImmutableMap<Key<?>, Object> exposedKeysToSources

lazily instantiated

exposureBuildersback to summary
private List<ExposureBuilder<?>> exposureBuilders
injectorback to summary
private Injector injector
sourceback to summary
private final Object source

Constructor Detail

PrivateElementsImplback to summary
public PrivateElementsImpl(Object source)

Method Detail

acceptVisitorback to summary
public <T> T acceptVisitor(ElementVisitor<T> visitor)

Implements com.google.inject.spi.Element.acceptVisitor.

Doc from com.google.inject.spi.Element.acceptVisitor.

Accepts an element visitor. Invokes the visitor method specific to this element's type.

Parameters
visitor:ElementVisitor<T>

to call back on

Annotations
@Override
addExposureBuilderback to summary
public void addExposureBuilder(ExposureBuilder<?> exposureBuilder)
applyToback to summary
public void applyTo(Binder binder)

Implements com.google.inject.spi.Element.applyTo.

Doc from com.google.inject.spi.Element.applyTo.

Writes this module element to the given binder (optional operation).

Parameters
binder:Binder

to apply configuration element to

Annotations
@Override
getElementsback to summary
public List<Element> getElements()

Implements com.google.inject.spi.PrivateElements.getElements.

Doc from com.google.inject.spi.PrivateElements.getElements.

Returns the configuration information in this private environment.

Annotations
@Override
getElementsMutableback to summary
public List<Element> getElementsMutable()
getExposedKeysback to summary
public Set<Key<?>> getExposedKeys()

Implements com.google.inject.spi.PrivateElements.getExposedKeys.

Doc from com.google.inject.spi.PrivateElements.getExposedKeys.

Returns the unique exposed keys for these private elements.

Annotations
@Override
getExposedSourceback to summary
public Object getExposedSource(Key<?> key)

Implements com.google.inject.spi.PrivateElements.getExposedSource.

Doc from com.google.inject.spi.PrivateElements.getExposedSource.

Returns an arbitrary object containing information about the "place" where this key was exposed. Used by Guice in the production of descriptive error messages.

Tools might specially handle types they know about; StackTraceElement is a good example. Tools should simply call toString() on the source object if the type is unfamiliar.

Parameters
key:Key<?>

one of the keys exposed by this module.

Annotations
@Override
getInjectorback to summary
public Injector getInjector()

Implements com.google.inject.spi.PrivateElements.getInjector.

Doc from com.google.inject.spi.PrivateElements.getInjector.

Returns the child injector that hosts these private elements, or null if the elements haven't been used to create an injector.

Annotations
@Override
getSourceback to summary
public Object getSource()

Implements com.google.inject.spi.Element.getSource.

Doc from com.google.inject.spi.Element.getSource.

Returns an arbitrary object containing information about the "place" where this element was configured. Used by Guice in the production of descriptive error messages.

Tools might specially handle types they know about; StackTraceElement is a good example. Tools should simply call toString() on the source object if the type is unfamiliar.

Annotations
@Override
initInjectorback to summary
public void initInjector(Injector injector)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override