Table des matières

Constructs in the component model

They are associated or derived from one or several annotations in the code

The definitions changed from the version designed in Prague (previous version)

Component - Class Relation

/**
 * One or more Java classes can be assigned to a single component. Such an
 * assignment is specified by this annotation.
 */
@Target(ElementType.TYPE)
public @interface InComponent {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing component
         *         Names which the annotated class is assigned to. If a single
         *         source declares the class to participate in several components,
         *         its entry should be a comma-separated list of component name
         */
        String[] componentName();
}

Entry points

/**
 * This class is the first instantiated and is responsible (its constructor) for
 * the instantiation and initialization of the component’s content.
 */
@Target(ElementType.TYPE)
// Should be just a class
public @interface InitClass {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing component
         *         Names for which the annotated class provides the initialization.
         *         If a single source declares the class to participate in several
         *         components, its entry should be a comma-separated list of
         *         component name
         */
 
        String[] componentName();
}
/**
 * The component content is instantiated and initialized by a method ( it can be
 * a constructor, a static method or an initialization method to be called after
 * the default constructor).
 */
@Target( { ElementType.CONSTRUCTOR, ElementType.METHOD })
public @interface InitMethod {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing component
         *         Names for which the annotated method provides the initialization.
         * 
         */
        String[] componentName();
}

Interfaces

Provided

/**
 * In Java sources, a provided interface might be in a form of a class
 * attribute. The attribute stores a reference to a class implementing the
 * provided interface.
 * 
 */
@Target(ElementType.FIELD)
public @interface Provided {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing the name
         *         of the interface represented by this field
         */
        String[] modelIfaceName();
}
/**
 * All methods of the specified Java interface (which the annotated class has to
 * implement) are marked as a part of the provided interface of the component
 * 
 */
@Target(ElementType.TYPE)
public @interface ProvidedIf {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing the name
         *         of the component interface represented by this type
         */
 
        String[] modelIfaceName();
 
        /**
         * @return the array (one entry per annotation source) containing the name
         *         of the java interface which is defining one component Interface
         *         If a single source declares to participate in several components,
         *         its entry should be a comma-separated list of java interface
         *         names (for instance {"ActionListener,WindowListener"}
         */
 
        String[] javaIfaceName() default { "" };
}
/**
 * The method is a part of the provided interface of the component
 * 
 */
@Target(ElementType.METHOD)
public @interface ProvidedMethod {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing the name
         *         of the component interface which the annotated method is part of.
         *         If a single source declares to the method participate in several
         *         interfaces, its entry should be a comma-separated list of
         *         interface names
         */
        String[] modelIfaceName();
}

Required

/**
 * In Java sources, a required interface is present in a form of a class
 * attribute. The attribute stores a reference to another component, whose
 * provided interface is bound to this required interfaces. Therefore, the
 * target of the annotation for required interface is an attribute of a Java
 * class
 */
@Target(ElementType.FIELD)
public @interface Required {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
 
        /**
         * @return the array (one entry per annotation source) containing the name
         *         of the interface represented by this field
         */
        String[] modelIfaceName();
}

Business elements

/**
 * all the instances of such type are important for a component behaviour.
 */
@Target(ElementType.TYPE)
public @interface BusinessType {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
}
/**
 * Marks particular Java class attributes as important for business logic.
 */
 
@Target(ElementType.FIELD)
public @interface BusinessField {
 
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
}
/**
 * Marks particular method parameter as important for business logic.
 * 
 */
@Target(ElementType.PARAMETER)
public @interface BusinessParameter {
        /**
         * @return the array of sources for this annotation
         */
        String[] annotationSrc();
}