myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "MyfacesBuilderPlugin" by SimonKitching
Date Mon, 24 Mar 2008 21:16:54 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by SimonKitching:
http://wiki.apache.org/myfaces/MyfacesBuilderPlugin

The comment on the change is:
Add info about qdox and java15 annotations

------------------------------------------------------------------------------
  
  The main guidelines for achieving the objectives are:
  
+  1. Use annotations while preserving java1.4 compatibility
-  1. Use annotations on the javadoc (use Qdox for read this data).
-  2. java15 annotations are not used because
- {{{
-    a. we want to support 1.4.
-    b. java15 compile-retention annotations are not nice to work with.
-    c. we explicitly want the javadoc comments.
- }}}
-  3. Possible use a template tool like velocity to generate the files (for avoid recompile
of the code when errors found)(in discussion).
+  2. Possible use a template tool like velocity to generate the files (for avoid recompile
of the code when errors found)(in discussion).
-  4. Simplify the code based on myfaces-faces-plugin.
+  3. Simplify the code based on myfaces-faces-plugin.
+ 
+ The tool proposed to achieve (1) above is the qdox library (qdox.sourceforge.net). This
is a java source parser that is used as the
+ base for the well-known xdoclet project. QDox can be used to process either "real" source-retention
java1.5 annotations (even on
+ java1.4), or doclet tags embedded in javadoc comments with just a very minor alteration
to the plugin code. This therefore means
+ that the same plugin can be used to handle JSF1.1-compatible and JSF1.2-compatible code.
Therefore both of the two syntaxes can 
+ fairly easily be supported concurrently by the same plugin:
+ {{{
+   /**
+    * Some Foo property.
+    * @mfp.property literalOnly="true"
+    */
+   public abstract String getFoo();
+ }}}
+ and
+ {{{
+   /**
+    * Some Foo property.
+    */
+   @MFP_Property(literalOnly=true)
+   public abstract String getFoo();
+ }}}
+ 
+ Note that processing source annotations with the Sun APT tool is far more difficult; it
is a command-line only tool, is 
+ a sun-specific extension, requires java1.5, and does not (AFAIK) give any access to the
javadoc comments attached to
+ the annotated node. The Qdox library is portable, and supports doclet-style annotations
too.
  
  == Guidelines and relevant points per module ==
  
@@ -191, +210 @@

  
  }}}
  
+ Note that as described in an earlier section, an equivalent syntax with java1.5 annotations
can also be supported
+ concurrently by the plugin. For simplicity, only the doclet-annotation form is shown above.
  
  === Component class generation ===
  

Mime
View raw message