public final class FactoryProvider2<F> extends java.lang.Object implements java.lang.reflect.InvocationHandler, Provider<F>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
F |
get()
Provides an instance of
T . |
Binding<?> |
getBindingFromNewInjector(java.lang.reflect.Method method,
java.lang.Object[] args)
Creates a child injector that binds the args, and returns the binding for the method's result.
|
int |
hashCode() |
void |
initialize(Injector injector)
At injector-creation time, we initialize the invocation handler.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.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.
|
java.lang.String |
toString() |
public F get()
Provider
T
. Must never return null
.@Inject public void initialize(Injector injector)
public Binding<?> getBindingFromNewInjector(java.lang.reflect.Method method, java.lang.Object[] args)
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object