public final class FactoryProvider2<F> extends Object implements InvocationHandler, Provider<F>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
F |
get()
Provides an instance of
T . |
Binding<?> |
getBindingFromNewInjector(Method method,
Object[] args)
Creates a child injector that binds the args, and returns the binding for the method's result.
|
void |
initialize(Injector injector)
At injector-creation time, we initialize the invocation handler.
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
When a factory method is invoked, we create a child injector that binds all parameters, then
use that to get an instance of the return type.
|
String |
toString() |
public F get()
Provider
T
. Must never return null
.@Inject public void initialize(Injector injector)
public Binding<?> getBindingFromNewInjector(Method method, Object[] args)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
Copyright © 2009–2016. All rights reserved.