Package org.apache.wicket.injection
Class Injector
- java.lang.Object
-
- org.apache.wicket.injection.Injector
-
- Direct Known Subclasses:
GuiceComponentInjector
,SpringComponentInjector
public abstract class Injector extends Object
Injector scans fields of an object instance and checks if the specifiedIFieldValueFactory
can provide a value for a field; if it can, the field is set to that value. Injector will ignore all non-null fields.- Author:
- Igor Vaynberg (ivaynberg)
-
-
Constructor Summary
Constructors Constructor Description Injector()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
bind(Application application)
Binds current instance of the injector to the Application.static Injector
get()
abstract void
inject(Object object)
Injects the specified object.protected void
inject(Object object, IFieldValueFactory factory)
traverse fields in the class hierarchy of the object and set their value with a locator provided by the locator factory.
-
-
-
Constructor Detail
-
Injector
public Injector()
-
-
Method Detail
-
bind
public void bind(Application application)
Binds current instance of the injector to the Application. After this method is called this instance of injector will be returned from subsequent calls toget()
whenever the specified application object is active in the thread.- Parameters:
application
-
-
inject
public abstract void inject(Object object)
Injects the specified object. This method is usually implemented by delegating toinject(Object, IFieldValueFactory)
with someIFieldValueFactory
- Parameters:
object
-- See Also:
inject(Object, IFieldValueFactory)
-
inject
protected void inject(Object object, IFieldValueFactory factory)
traverse fields in the class hierarchy of the object and set their value with a locator provided by the locator factory.- Parameters:
object
-factory
-
-
-