public class DependencyInjector extends Object
setCustomInjector(javafx.util.Callback<java.lang.Class<?>, java.lang.Object>).| Modifier and Type | Method and Description |
|---|---|
javafx.util.Callback<Class<?>,Object> |
getCustomInjector()
See
setCustomInjector(javafx.util.Callback) for more details. |
static DependencyInjector |
getInstance() |
<T> T |
getInstanceOf(Class<? extends T> type)
Returns an instance of the given type.
|
boolean |
isCustomInjectorDefined() |
void |
setCustomInjector(javafx.util.Callback<Class<?>,Object> callback)
Define a custom injector that is used to retrieve instances.
|
public static DependencyInjector getInstance()
public <T> T getInstanceOf(Class<? extends T> type)
setCustomInjector(javafx.util.Callback))
then this injector is used.
Otherwise a new instance of the desired type is created. This is done by a call to Class.newInstance() which means that all constraints
of the newInstance method are also need to be satisfied.T - type - public javafx.util.Callback<Class<?>,Object> getCustomInjector()
setCustomInjector(javafx.util.Callback) for more details.public void setCustomInjector(javafx.util.Callback<Class<?>,Object> callback)
FXMLLoader.setControllerFactory(javafx.util.Callback)
method.callback - the callback that returns instances of a specific class type.public boolean isCustomInjectorDefined()
Copyright © 2014 Saxonia Systems AG. All rights reserved.