org.apache.wicket.injection
Class ComponentInjector

java.lang.Object
  extended by org.apache.wicket.injection.ComponentInjector
All Implemented Interfaces:
IComponentInstantiationListener
Direct Known Subclasses:
SpringComponentInjector

public class ComponentInjector
extends Object
implements IComponentInstantiationListener

Enables your application to do dependency injection. To use, register the injector as a IComponentInstantiationListener like this:

      ... (in your application's constructor or init method)
      addComponentInstantiationListener(new ComponentInjector());
      ...
 

Author:
Eelco Hillenius
See Also:
IComponentInstantiationListener, Application.addComponentInstantiationListener(org.apache.wicket.application.IComponentInstantiationListener)

Constructor Summary
ComponentInjector()
          Construct.
 
Method Summary
 void onInstantiation(Component component)
          Called for every component that is instantiated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentInjector

public ComponentInjector()
Construct.

Method Detail

onInstantiation

public void onInstantiation(Component component)
Description copied from interface: IComponentInstantiationListener
Called for every component that is instantiated. This method is called during construction, so do not depend on the construction being completed yet. The id is guaranteed to be set before this call.

Specified by:
onInstantiation in interface IComponentInstantiationListener
Parameters:
component - the component that is being instantiated.
See Also:
IComponentInstantiationListener.onInstantiation(org.apache.wicket.Component)


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