|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.injection.Injector org.apache.wicket.guice.GuiceComponentInjector
public class GuiceComponentInjector
Injects field members of components using Guice.
Add this to your application in its Application.init()
method like so:
addComponentInstantiationListener(new GuiceComponentInjector(this));
There are different constructors for this object depending on how you want to wire things. See the javadoc for the constructors for more information.
Constructor Summary | |
---|---|
GuiceComponentInjector(Application app)
Creates a new Wicket GuiceComponentInjector instance. |
|
GuiceComponentInjector(Application app,
com.google.inject.Injector injector)
Constructor |
|
GuiceComponentInjector(Application app,
com.google.inject.Injector injector,
boolean wrapInProxies)
Creates a new Wicket GuiceComponentInjector instance, using the provided Guice Injector instance. |
|
GuiceComponentInjector(Application app,
com.google.inject.Module... modules)
Creates a new Wicket GuiceComponentInjector instance, using the supplied Guice Module
instances to create a new Guice Injector instance internally. |
Method Summary | |
---|---|
void |
inject(java.lang.Object object)
Injects the specified object. |
void |
onInstantiation(Component component)
Called for every component that is instantiated. |
Methods inherited from class org.apache.wicket.injection.Injector |
---|
bind, get, inject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuiceComponentInjector(Application app)
Internally this will create a new Guice Injector
instance, with no Module
instances. This is only useful if your beans have appropriate ImplementedBy
annotations on them so that they can be automatically picked up with no extra configuration
code.
app
- public GuiceComponentInjector(Application app, com.google.inject.Module... modules)
Module
instances to create a new Guice Injector
instance internally.
app
- modules
- public GuiceComponentInjector(Application app, com.google.inject.Injector injector)
app
- injector
- public GuiceComponentInjector(Application app, com.google.inject.Injector injector, boolean wrapInProxies)
Injector
instance.
app
- injector
- wrapInProxies
- whether or not wicket should wrap dependencies with specialized proxies that can
be safely serialized. in most cases this should be set to true.Method Detail |
---|
public void inject(java.lang.Object object)
Injector.inject(Object, IFieldValueFactory)
with some IFieldValueFactory
inject
in class Injector
Injector.inject(Object, IFieldValueFactory)
public void onInstantiation(Component component)
onInstantiation
in interface IComponentInstantiationListener
component
- the component that is being instantiated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |