James Carman schrieb:
What if the complex type isn't instantiatable? What if the only way
to instantiate it is via a factory method?
What do you mean with 'not instantiatable'? Why?
The getFactoryConfig() can call a service or whatever
you can think of to create an instance of the container.
Achim
On 11/7/06, Apache Wiki <[EMAIL PROTECTED]> wrote:
Dear Wiki user,
You have subscribed to a wiki page or wiki category on
"Jakarta-hivemind Wiki" for change notification.
The following page has been changed by AchimHuegen:
http://wiki.apache.org/jakarta-hivemind/NewAndNoteworthyFeaturesInAnnotationBranch
------------------------------------------------------------------------------
The container object is passed around to the different
contributions which can add new
data to it.
- Example for a map based configuration:
+ Example of a map based configuration:
{{{
@Configuration(id = "FactoryConfig")
public Map getFactoryConfig()
@@ -153, +153 @@
container.put("map", "java.util.HashMap");
container.put("collection", "java.util.ArrayList");
container.put("inputStream", "java.io.ByteArrayInputStream");
+ }
+ }}}
+
+ Example of a complex configuration object:
+ {{{
+ @Configuration(id = "strutsModule")
+ public ModuleConfig getStrutsModule()
+ {
+ return new ModuleConfigImpl();
+ }
+
+ @Contribution(configuration-id = "strutsModule")
+ public void contributeToStrutsModule(ModuleConfig config)
+ {
+ config.addActionConfig(new ActionConfig());
+ config.addFormBeanConfig(new MyFormBeanConfig());
}
}}}
@@ -192, +208 @@
It's mainly used to retain backward compatibility. Certain
configurations are defined
in the core framework now which knows nothing about schemas.
-
-