Apache MyFaces
Project Documentation
Foundation

Doclets and Annotations

To annotate the necessary information in component / converter / validator / renderkit / renderer / tag files you can use doclets:

    /**
     * This is a doclet
     *
     * @JSFProperty
     *       required = "true"
     *       defaultValue = "AnyValue"
     **/
    

or annotations

    /**
     * This is an annotation
     *
     **/
     @JSFProperty(
          required = true,
          defaultValue = "AnyValue")

Doclets and annotations can be used on both jsf 1.1 and jsf 1.2, but since jsf 1.1 is jdk 1.4 compatible, it is preferred to use doclets with jsf 1.1 (note that if you use annotations, your source code should be jdk 1.5 in order to compile).

The differences between doclets and annotations are listed below:

  • Attribute names like "class", "implements" in annotated version are "clazz" and "implementz".
  • All attribute values in doclets must be between "". In annotations boolean attributes must not (see "required" example below).
  • Usage of annotations like @JSFJspProperties and @JSFRenderers are not required on doclets.

Taking into account the previous differences, you can consult the annotation javadoc for doclets.