Configuration
Description
Declaration of a default arbitary XML configuration within the component directive.
Attributes
The configuration element supports any user defined attribute or element value.
Nested Elements
Any user defined nested element is allowed.
Example
The following example demonstrates the creation of an arbitary XML configuration directive. The configuration element supports any user supplied attribute and any user supplied element name.
<component xmlns="dpml:metro" dest="target/test/config.part" test="true" activation="true" type="net.dpml.test.config.ConfigurableComponent" collection="hard"> <configuration name="fred"> <place>Cafe d'Orleans</place> <item name="breakfast" value="Cafe et Crossant"/> <item name="lunch" value="Salade de Sud-Oust"/> <item name="dinner" value="Margret de Canard"/> </configuration> </component>
Technical Notes
The declaration of a configuration presumes that the component implementation declares a constructor argument that is type assignable to an instance of Configuration (a.k.a. the classic Avalon style configuration object).
public class ConfigurableComponent { private final Configuration m_config; public ConfigurableComponent( Configuration config ) { m_config = config; } ... }