@Component(value="defaultContainerFactory") public class SpringConfiguredContainerFactory extends ContainerFactory
private SpringConfiguredContainerFactory factory = AppSettings.get().WICKET_CONTAINER_FACTORY;
or
private SpringConfiguredContainerFactory factory = AppSettings.get()springContext.getBean(SpringConfiguredContainerFactory.class);
deriveId(MarkupContainer)
; to determine the name in the Spring configs (properties). The property would be namespace
+ Class.getName()
.
If the class is an anonymous class then the super Class.getName()
is used.
TODO: Build an annotation alternative to the factory, which at RUNTIME scans a wicket parent and replaces its child with the overriding component.deriveId(MarkupContainer)
,
http://apache-wicket.1842946.n4.nabble.com/Use-a-Factory-to-create-a-Panel-Yay-or-Nay-td4673622.html
,
Serialized Forminstance
Modifier | Constructor and Description |
---|---|
protected |
SpringConfiguredContainerFactory() |
Modifier and Type | Method and Description |
---|---|
static <T extends org.apache.wicket.MarkupContainer> |
build(T baseImpl)
Based on contextual configurations get an Overriding panel.
|
String |
getNamespace()
Namespace for all Beans referred to that this factory will pick from
Environment |
protected String |
getProperty(String key)
Derive class name from the environment configuration
|
void |
setNamespace(String namespace)
Namespace for all Beans referred to that this factory will pick from
Environment |
protected String getProperty(String key) throws Exception
key
- as StringException
public static <T extends org.apache.wicket.MarkupContainer> T build(T baseImpl)
deriveId(MarkupContainer)
and then attempt construction using either of the common constructors using (Id) or (id, IModel
).baseImpl
- as MarkupContainer
public String getNamespace()
Environment
public void setNamespace(String namespace)
Environment
Copyright © 2018. All rights reserved.