|
||||||||||
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.spring.injection.annot.SpringComponentInjector
public class SpringComponentInjector
IComponentInstantiationListener
that injects component properties annotated with
SpringBean
annotations.
To install in yourapplication.init() call
addComponentInstantiationListener(new SpringComponentInjector(this));
Non-wicket
components such as Session
, Model
, and any other pojo can be injected by calling
Injector.get().inject(this)
in their constructor.
Constructor Summary | |
---|---|
SpringComponentInjector(WebApplication webapp)
Constructor used when spring application context is declared in the spring standard way and can be located through WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContext) |
|
SpringComponentInjector(WebApplication webapp,
org.springframework.context.ApplicationContext ctx)
Constructor |
|
SpringComponentInjector(WebApplication webapp,
org.springframework.context.ApplicationContext ctx,
boolean wrapInProxies)
Constructor |
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 SpringComponentInjector(WebApplication webapp)
WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContext)
webapp
- wicket web applicationpublic SpringComponentInjector(WebApplication webapp, org.springframework.context.ApplicationContext ctx)
webapp
- wicket web applicationctx
- spring's application contextpublic SpringComponentInjector(WebApplication webapp, org.springframework.context.ApplicationContext ctx, boolean wrapInProxies)
webapp
- wicket web applicationctx
- spring's application contextwrapInProxies
- 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 |