Top Description Methods
com.google.inject.spi

public Interface PrivateElements

extends Element
Known Direct Implementers
com.google.inject.internal.PrivateElementsImpl
Imports
com.google.inject.Injector, .Key, java.util.List, .Set

A private collection of elements that are hidden from the enclosing injector or module by default. See PrivateModule for details.
Author
[email protected] (Jesse Wilson)
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public List<Element>
getElements()

Returns the configuration information in this private environment.

public Set<Key<?>>
getExposedKeys()

Returns the unique exposed keys for these private elements.

public Object
getExposedSource(Key<?>
one of the keys exposed by this module.
key
)

Returns an arbitrary object containing information about the "place" where this key was exposed.

public Injector
getInjector()

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

Inherited from com.google.inject.spi.Element:
acceptVisitorapplyTogetSource

Method Detail

getElementsback to summary
public List<Element> getElements()

Returns the configuration information in this private environment.

getExposedKeysback to summary
public Set<Key<?>> getExposedKeys()

Returns the unique exposed keys for these private elements.

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

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.

getInjectorback to summary
public Injector getInjector()

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