public class InjectorImpl extends Object implements Injector
| Constructor and Description |
|---|
InjectorImpl(Configuration c) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
bindAspect(Aspect a)
Binds a TANG Aspect to this injector.
|
<T> void |
bindVolatileInstance(Class<T> c,
T o)
Binds the given object to the class.
|
<T> void |
bindVolatileParameter(Class<? extends Name<T>> c,
T o) |
Injector |
forkInjector() |
Injector |
forkInjector(Configuration... configurations)
Create a copy of this Injector that inherits the instances that were already
created by this Injector, but reflects additional Configuration objects.
|
Aspect |
getAspect()
Allows InjectionFuture to tell the aspect when get() is invoked.
|
<T> InjectionPlan<T> |
getInjectionPlan(Class<T> name) |
InjectionPlan<?> |
getInjectionPlan(Node n)
Return an injection plan for the given class / parameter name.
|
InjectionPlan<?> |
getInjectionPlan(String name) |
<U> U |
getInstance(Class<U> clazz)
Gets an instance of iface, or the implementation that has been bound to it.
|
<U> U |
getInstance(String clazz) |
<T> T |
getNamedInstance(Class<? extends Name<T>> clazz)
Gets the value stored for the given named parameter.
|
<T> T |
getNamedParameter(Class<? extends Name<T>> clazz) |
boolean |
isInjectable(Class<?> clazz) |
boolean |
isInjectable(String name)
Returns true if this Injector is able to instantiate the object named by
name.
|
boolean |
isParameterSet(Class<? extends Name<?>> name) |
boolean |
isParameterSet(String name) |
public InjectorImpl(Configuration c) throws BindException
BindExceptionpublic InjectionPlan<?> getInjectionPlan(Node n)
n - The name of an injectable class or interface, or a NamedParameter.NameResolutionExceptionpublic InjectionPlan<?> getInjectionPlan(String name) throws NameResolutionException
getInjectionPlan in interface InjectorNameResolutionExceptionpublic <T> InjectionPlan<T> getInjectionPlan(Class<T> name)
getInjectionPlan in interface Injectorpublic boolean isInjectable(String name) throws NameResolutionException
InjectorisInjectable in interface InjectorNameResolutionExceptionpublic boolean isInjectable(Class<?> clazz)
isInjectable in interface Injectorpublic boolean isParameterSet(String name) throws NameResolutionException
isParameterSet in interface InjectorNameResolutionExceptionpublic boolean isParameterSet(Class<? extends Name<?>> name) throws BindException
isParameterSet in interface InjectorBindExceptionpublic <U> U getInstance(Class<U> clazz) throws InjectionException
InjectorgetInstance in interface InjectorInjectionExceptionpublic <U> U getInstance(String clazz) throws InjectionException, NameResolutionException
getInstance in interface InjectorInjectionExceptionNameResolutionExceptionpublic <T> T getNamedInstance(Class<? extends Name<T>> clazz) throws InjectionException
InjectorgetNamedInstance in interface InjectorInjectionExceptionpublic <T> T getNamedParameter(Class<? extends Name<T>> clazz) throws InjectionException
InjectionExceptionpublic <T> void bindVolatileInstance(Class<T> c, T o) throws BindException
InjectorbindVolatileInstance in interface InjectorBindExceptionpublic <T> void bindVolatileParameter(Class<? extends Name<T>> c, T o) throws BindException
bindVolatileParameter in interface InjectorBindExceptionpublic Injector forkInjector()
forkInjector in interface Injectorpublic Injector forkInjector(Configuration... configurations) throws BindException
InjectorforkInjector in interface InjectorBindException - If any of the configurations conflict with each other, or the
existing Injector's Configuration.public <T> void bindAspect(Aspect a) throws BindException
InjectorbindAspect in interface InjectorBindExceptionCopyright © 2015 The Apache Software Foundation. All rights reserved.