Class BindingImpl<T>
java.lang.Object
org.elasticsearch.common.inject.internal.BindingImpl<T>
- Direct Known Subclasses:
ExposedBindingImpl
,InstanceBindingImpl
,LinkedBindingImpl
,LinkedProviderBindingImpl
,ProviderInstanceBindingImpl
,UntargettedBindingImpl
public abstract class BindingImpl<T> extends java.lang.Object implements Binding<T>
-
Constructor Summary
Constructors Modifier Constructor Description protected
BindingImpl(java.lang.Object source, Key<T> key, Scoping scoping)
BindingImpl(Injector injector, Key<T> key, java.lang.Object source, InternalFactory<? extends T> internalFactory, Scoping scoping)
-
Method Summary
Modifier and Type Method Description <V> V
acceptScopingVisitor(BindingScopingVisitor<V> visitor)
Accepts a scoping visitor.<V> V
acceptVisitor(ElementVisitor<V> visitor)
Accepts an element visitor.Injector
getInjector()
InternalFactory<? extends T>
getInternalFactory()
Key<T>
getKey()
Returns the key for this binding.Provider<T>
getProvider()
Returns the scoped provider guice uses to fulfill requests for this binding.Scoping
getScoping()
java.lang.Object
getSource()
Returns an arbitrary object containing information about the "place" where this element was configured.boolean
isConstant()
Is this a constant binding? This returns true for constant bindings as well as toInstance() bindings.java.lang.String
toString()
protected BindingImpl<T>
withKey(Key<T> key)
protected BindingImpl<T>
withScoping(Scoping scoping)
-
Constructor Details
-
Method Details
-
getKey
Description copied from interface:Binding
Returns the key for this binding. -
getSource
public java.lang.Object getSource()Description copied from interface:Element
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 calltoString()
on the source object if the type is unfamiliar. -
getProvider
Description copied from interface:Binding
Returns the scoped provider guice uses to fulfill requests for this binding.- Specified by:
getProvider
in interfaceBinding<T>
-
getInternalFactory
-
getScoping
-
isConstant
public boolean isConstant()Is this a constant binding? This returns true for constant bindings as well as toInstance() bindings. -
acceptVisitor
Description copied from interface:Element
Accepts an element visitor. Invokes the visitor method specific to this element's type.- Specified by:
acceptVisitor
in interfaceElement
- Parameters:
visitor
- to call back on
-
acceptScopingVisitor
Description copied from interface:Binding
Accepts a scoping visitor. Invokes the visitor method specific to this binding's scoping.- Specified by:
acceptScopingVisitor
in interfaceBinding<T>
- Parameters:
visitor
- to call back on
-
withScoping
-
withKey
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getInjector
-