public final class PrivateElementsImpl extends java.lang.Object implements PrivateElements
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.collect.ImmutableList<Element> |
elements
lazily instantiated
|
private java.util.List<Element> |
elementsMutable |
private com.google.common.collect.ImmutableMap<Key<?>,java.lang.Object> |
exposedKeysToSources
lazily instantiated
|
private java.util.List<ExposureBuilder<?>> |
exposureBuilders |
private Injector |
injector |
private java.lang.Object |
source |
| Constructor and Description |
|---|
PrivateElementsImpl(java.lang.Object source) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
acceptVisitor(ElementVisitor<T> visitor)
Accepts an element visitor.
|
void |
addExposureBuilder(ExposureBuilder<?> exposureBuilder) |
void |
applyTo(Binder binder)
Writes this module element to the given binder (optional operation).
|
java.util.List<Element> |
getElements()
Returns the configuration information in this private environment.
|
java.util.List<Element> |
getElementsMutable() |
java.util.Set<Key<?>> |
getExposedKeys()
Returns the unique exposed keys for these private elements.
|
java.lang.Object |
getExposedSource(Key<?> key)
Returns an arbitrary object containing information about the "place" where this key was
exposed.
|
Injector |
getInjector()
Returns the child injector that hosts these private elements, or null if the elements haven't
been used to create an injector.
|
java.lang.Object |
getSource()
Returns an arbitrary object containing information about the "place" where this element was
configured.
|
void |
initInjector(Injector injector) |
java.lang.String |
toString() |
private final java.lang.Object source
private java.util.List<Element> elementsMutable
private java.util.List<ExposureBuilder<?>> exposureBuilders
private com.google.common.collect.ImmutableList<Element> elements
private com.google.common.collect.ImmutableMap<Key<?>,java.lang.Object> exposedKeysToSources
private Injector injector
public java.lang.Object getSource()
ElementTools 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.
public java.util.List<Element> getElements()
PrivateElementsgetElements in interface PrivateElementspublic Injector getInjector()
PrivateElementsgetInjector in interface PrivateElementspublic void initInjector(Injector injector)
public java.util.Set<Key<?>> getExposedKeys()
PrivateElementsgetExposedKeys in interface PrivateElementspublic <T> T acceptVisitor(ElementVisitor<T> visitor)
ElementacceptVisitor in interface Elementvisitor - to call back onpublic java.util.List<Element> getElementsMutable()
public void addExposureBuilder(ExposureBuilder<?> exposureBuilder)
public void applyTo(Binder binder)
Elementpublic java.lang.Object getExposedSource(Key<?> key)
PrivateElementsTools 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.
getExposedSource in interface PrivateElementskey - one of the keys exposed by this module.public java.lang.String toString()
toString in class java.lang.Object