Javadoc TagsEntry TagThe entry tag declares a context entry required by a component. The component is supplied the context entry via a context argument as part of the contextualization lifecycle stage. Context entries my declare a object type or array of object types. If the type is not declared java.lang.String is assumed. Context entries may be declared as option. The default behaviour is to assume that a context entry is required. package net.osm; /** * Example of a component declaring a context entry dependencies. * * @avalon.meta.version 1.0 * @avalon.meta.name entry-demo */ public class Primary implements Contextualizable { /** * @avalon.meta.entry type="java.io.File" key="home" optional="true" * @avalon.meta.entry key="table" type="java.lang.Object[]" * @avalon.meta.entry key="name" */ public void contextualize( Context context ) throws ContextException { String name = (String) context.get( "name" ); Object[] array = (Object[]) context.get( "table" ); try { File home = (File) context.get( "home" ); ... } catch( ContextException ce ) { // it's optional } } } Generated meta-info type descriptor: <type> <info> <version>1.3.0</version> <name>primary-component</name> </info> <context> <entry key="home" type="java.io.File" optional="true"/> <entry key="table" type="java.lang.Object[]" optional="false"/> <entry key="name" type="java.lang.String" optional="false"/> </context> </type> |