org.apache.wicket.injection
Class Injector

java.lang.Object
  extended by org.apache.wicket.injection.Injector
Direct Known Subclasses:
ConfigurableInjector

public class Injector
extends Object

Injector scans fields of an object instance and checks if the specified IFieldValueFactory 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
Injector()
           
 
Method Summary
static Injector getInstance()
           
 Object 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.
protected  boolean isBoundaryClass(Class<?> clazz)
          When the initializer traverses the hierarchy of the specified object it will stop if it encounters a boundary class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Injector

public Injector()
Method Detail

getInstance

public static Injector getInstance()
Returns:
static instance of ProxyInjector

isBoundaryClass

protected boolean isBoundaryClass(Class<?> clazz)
When the initializer traverses the hierarchy of the specified object it will stop if it encounters a boundary class. By default, more common wicket classes are defined as boundaries so that the initializer does not waste time traversing them.

Parameters:
clazz - class to be tested for being a boundary class
Returns:
true if the class is a boundary class, false otherwise

inject

public Object 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 -
Returns:
Object that was injected - used for chaining


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.