Previous Section  < Day Day Up >  Next Section

<component>

The <component> element declares the implementation class for a component type.

Syntax

<component>

  [<description [xml:lang="lang"]>description</description>]*

  [<display-name [xml:lang="lang"]>displayName</display-name>]*

  [<icon [xml:lang="lang"]>

     [<small-icon>iconPath</small-icon>]

     [<large-icon>iconPath</large-icon>]

   </icon>]*

  <component-type>componentType</component-type>

  <component-class>className</component-class>

  [<attribute>

    [<description [xml:lang="lang"]>description</description>]*

    [<display-name [xml:lang="lang"]>displayName</display-name>]*

    [<icon [xml:lang="lang"]>

       [<small-icon>iconPath</small-icon>]

       [<large-icon>iconPath</large-icon>]

     </icon>]*

     <attribute-name>attrName</attribute-name>

     <attribute-class>className</attribute-class>

     [<default-value>defaultValue</default-value>]

     [<suggested-value>suggestedValue</suggested-value>]

     [<attribute-extension>extension</attribute-extension>]*

   </attribute>]*

  [<property>

    [<description [xml:lang="lang"]>description</description>]*

    [<display-name [xml:lang="lang"]>displayName</display-name>]*

    [<icon [xml:lang="lang"]>

       [<small-icon>iconPath</small-icon>]

       [<large-icon>iconPath</large-icon>]

     </icon>]*

     <property-name>propName</property-name>

     <property-class>className</property-class>

     [<default-value>defaultValue</default-value>]

     [<suggested-value>suggestedValue</suggested-value>]

     [<property-extension>extension</property-extension>]*

   </property>]*

   [<component-extension>extension</component-extension>]*

</component>

The <component-type> element declares a component type ID and the <component-class> element contains the fully qualified class name for the javax.faces.component.UIComponent subclass. These are the only mandatory elements:

<component>

  <component-type>com.mycompany.MyComponent</component-type>

  <component-class>

    com.mycompany.jsf.MyComponent

  </component-class>

</component>

The <attribute> and <property> elements provide information about the component's generic attributes and type-safe properties, respectively, that may be used by a development tool to help a developer use the component. They are optional but should be used at least for components used by a large group of developers. Subelements declare the name and the data type for the attribute or property, the <suggested-value> element declares a value a tool should suggest for the attribute or property, and the <default-value> the value used if none is set.

The extension elements for the attribute and property, as well as for the component, may be used for implementation-dependent elements.

    Previous Section  < Day Day Up >  Next Section