You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/04/25 05:53:00 UTC

svn commit: r651482 - in /myfaces/myfaces-build-tools/branches/builder_plugin: bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/ bigtest/core_trunk_11/api/src/main/resources/META-INF/ bigtest/core_trunk_11/impl/src/main/resources/META...

Author: lu4242
Date: Thu Apr 24 20:52:58 2008
New Revision: 651482

URL: http://svn.apache.org/viewvc?rev=651482&view=rev
Log:
move fields and methods without @JSFProperty or @JSFExclude done and used on HtmlDataTable

Added:
    myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java   (with props)
    myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/impl/src/main/resources/META-INF/myfaces_core.vm
Removed:
    myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/HtmlDataTable.java
Modified:
    myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlSelectManyCheckbox.java
    myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/resources/META-INF/componentClass11.vm
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ClassMeta.java
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile-flat.xml
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile.xml
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple/goodfile.xml
    myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple15/goodfile.xml

Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java?rev=651482&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java Thu Apr 24 20:52:58 2008
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component.html;
+
+import java.io.IOException;
+
+import javax.faces.component.UIData;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * This component renders as an HTML table element.  It has as its
+ * children h:column entities, which describe the columns of the table.
+ * It can be decorated with facets named "header" and "footer" to
+ * specify header and footer rows.
+ * 
+ * Unless otherwise specified, all attributes accept static values
+ * or EL expressions. 
+ * 
+ * Extend standard UIData component to add support for html-specific features
+ * such as CSS style attributes and event handler scripts.
+ * <p>
+ * see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>
+ * </p>
+ * 
+ * @JSFComponent
+ *   name = "h:dataTable"
+ *   class = "javax.faces.component.html.HtmlDataTable"
+ *   tagClass = "org.apache.myfaces.taglib.html.HtmlDataTableTag"
+ *   tagSuperclass = "javax.faces.webapp.UIComponentBodyTag"
+ *   desc = "h:dataTable"
+ *
+ * @author Thomas Spiegl (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+abstract class _HtmlDataTable extends UIData implements _EventProperties,
+    _StyleProperties, _UniversalProperties 
+{
+    /**
+     * @see javax.faces.component.UIData#encodeBegin(javax.faces.context.FacesContext)
+     */
+    public void encodeBegin(FacesContext context) throws IOException
+    {
+        // Ensure that the "current row" is set to "no row", so that the
+        // correct clientId is set for this component etc. User code may
+        // have left this in some other state before rendering began...
+        setRowIndex(-1);
+
+        // Now invoke the superclass encodeBegin, which will eventually
+        // execute the encodeBegin for the associated renderer.
+        super.encodeBegin(context);
+    }
+    
+    public static final String COMPONENT_TYPE = "javax.faces.HtmlDataTable";
+    private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Table";
+    
+    /**
+     * HTML: The background color of this element.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getBgcolor();
+
+    /**
+     * HTML: Specifies the width of the border of this element, in pixels.  Deprecated in HTML 4.01.
+     * 
+     * @JSFProperty
+     *   defaultValue="Integer.MIN_VALUE"
+     */
+    public abstract int getBorder();
+
+    /**
+     * HTML: Specifies the amount of empty space between the cell border and
+     * its contents.  It can be either a pixel length or a percentage.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getCellpadding();
+
+    /**
+     * HTML: Specifies the amount of space between the cells of the table.
+     * It can be either a pixel length or a percentage of available 
+     * space.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getCellspacing();
+
+    /**
+     * A comma separated list of CSS class names to apply to td elements in
+     * each column.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getColumnClasses();
+
+    /**
+     * The CSS class to be applied to footer cells.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getFooterClass();
+
+    /**
+     * HTML: Controls what part of the frame that surrounds a table is 
+     * visible.  Values include:  void, above, below, hsides, lhs, 
+     * rhs, vsides, box, and border.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getFrame();
+
+    /**
+     * The CSS class to be applied to header cells.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getHeaderClass();
+
+    /**
+     * A comma separated list of CSS class names to apply to td elements in
+     * each row.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getRowClasses();
+
+    /**
+     * HTML: Controls how rules are rendered between cells.  Values include:
+     * none, groups, rows, cols, and all.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getRules();
+
+    /**
+     * HTML: Provides a summary of the contents of the table, for
+     * accessibility purposes.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getSummary();
+
+    /**
+     * HTML: Specifies the desired width of the table, as a pixel length or
+     * a percentage of available space.
+     * 
+     * @JSFProperty
+     */
+    public abstract String getWidth();
+    
+}

Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlSelectManyCheckbox.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlSelectManyCheckbox.java?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlSelectManyCheckbox.java (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/java/javax/faces/component/html/_HtmlSelectManyCheckbox.java Thu Apr 24 20:52:58 2008
@@ -67,9 +67,6 @@
     public static final String COMPONENT_TYPE = "javax.faces.HtmlSelectManyCheckbox";
     private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Checkbox";
 
-    private Integer _border = null;
-    private String _layout = null;
-
     /**
      * HTML: Specifies the width of the border of this element, in pixels.  Deprecated in HTML 4.01.
      * 

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/resources/META-INF/componentClass11.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/resources/META-INF/componentClass11.vm?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/resources/META-INF/componentClass11.vm (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/api/src/main/resources/META-INF/componentClass11.vm Thu Apr 24 20:52:58 2008
@@ -31,7 +31,13 @@
 ##        "$component.family";
     static public final String COMPONENT_TYPE =
         "$component.type";
-    
+
+#if ($innersource)
+    //BEGIN CODE COPIED FROM $component.classSource 
+$innersource
+    //END CODE COPIED FROM $component.classSource
+#end
+
     public ${utils.getClassFromFullClass($component.className)}()
     {
 #if ($component.rendererType)

Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/impl/src/main/resources/META-INF/myfaces_core.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/impl/src/main/resources/META-INF/myfaces_core.vm?rev=651482&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/impl/src/main/resources/META-INF/myfaces_core.vm (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_11/impl/src/main/resources/META-INF/myfaces_core.vm Thu Apr 24 20:52:58 2008
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+   <tlib-version>1.0</tlib-version>
+   <jsp-version>1.2</jsp-version>
+   <short-name>$shortname</short-name>
+   <uri>$uri</uri>
+   <display-name>$displayname</display-name>
+   <description>$description</description>
+
+$baseContent
+
+    <!-- Component Tags -->
+#set ($componentList = ${model.getComponents()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId) 
+    && ($component.name))
+#if ($utils.getTagPrefix($component.name) == $shortname) 
+   <tag>
+      <name>$utils.getTagName($component.name)</name>
+      <tag-class>$component.tagClass</tag-class>
+#if ($component.bodyContent)
+      <body-content>$component.bodyContent</body-content>
+#else
+      <body-content>JSP</body-content>
+#end
+      <description><![CDATA[$component.longDescription]]></description>
+      
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+      <attribute>
+         <name>$property.name</name>
+         <required>$property.isRequired()</required>
+         <rtexprvalue>false</rtexprvalue>
+         <type>java.lang.String</type>
+         <description><![CDATA[$property.longDescription]]></description>
+      </attribute>
+#end
+#end
+   </tag>
+#end
+#end
+#end
+   <!-- Converter tags -->
+#set ($componentList = ${model.getConverters()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId) 
+    && ($component.name))
+#if ($utils.getTagPrefix($component.name) == $shortname) 
+   <tag>
+      <name>$utils.getTagName($component.name)</name>
+      <tag-class>$component.tagClass</tag-class>
+#if ($component.bodyContent)
+      <body-content>$component.bodyContent</body-content>
+#else
+      <body-content>empty</body-content>
+#end
+      <description><![CDATA[$component.longDescription]]></description>
+      
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+      <attribute>
+         <name>$property.name</name>
+         <required>$property.isRequired()</required>
+         <rtexprvalue>false</rtexprvalue>
+         <type>java.lang.String</type>
+         <description><![CDATA[$property.longDescription]]></description>
+      </attribute>
+#end
+#end
+   </tag>
+#end
+#end
+#end
+   <!-- Validator tags -->
+#set ($componentList = ${model.getValidators()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId) 
+    && ($component.name))
+#if ($utils.getTagPrefix($component.name) == $shortname) 
+   <tag>
+      <name>$utils.getTagName($component.name)</name>
+      <tag-class>$component.tagClass</tag-class>
+#if ($component.bodyContent)
+      <body-content>$component.bodyContent</body-content>
+#else
+      <body-content>empty</body-content>
+#end
+      <description><![CDATA[$component.longDescription]]></description>
+      
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+      <attribute>
+         <name>$property.name</name>
+         <required>$property.isRequired()</required>
+         <rtexprvalue>false</rtexprvalue>
+         <type>java.lang.String</type>
+         <description><![CDATA[$property.longDescription]]></description>
+      </attribute>
+#end
+#end
+   </tag>
+#end
+#end
+#end
+   <!-- Single Tags -->
+#set ($tagList = $model.getTags())
+#foreach( $tag in $tagList )
+#if ($modelIds.contains($tag.modelId))
+   <tag>
+      <name>$utils.getTagName($tag.name)</name>
+      <tag-class>$tag.className</tag-class>
+      <body-content>$tag.bodyContent</body-content>
+      <description><![CDATA[$tag.longDescription]]></description>
+#set ($attributeList = ${tag.attributeList})
+#foreach( $attribute in $attributeList )
+      <attribute>
+         <name>$attribute.name</name>
+         <required>$attribute.isRequired()</required>
+         <rtexprvalue>$attribute.isRtexprvalue()</rtexprvalue>
+#if ($attribute.className)         
+         <type>$attribute.className</type>
+#else
+         <type>java.lang.String</type>
+#end
+         <description><![CDATA[$attribute.longDescription]]></description>
+      </attribute>
+#end
+   </tag>
+#end
+#end
+</taglib>
\ No newline at end of file

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java Thu Apr 24 20:52:58 2008
@@ -22,6 +22,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
+import java.io.StringWriter;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -44,6 +45,15 @@
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 
+import com.thoughtworks.qdox.JavaDocBuilder;
+import com.thoughtworks.qdox.model.AbstractJavaEntity;
+import com.thoughtworks.qdox.model.Annotation;
+import com.thoughtworks.qdox.model.DocletTag;
+import com.thoughtworks.qdox.model.JavaClass;
+import com.thoughtworks.qdox.model.JavaField;
+import com.thoughtworks.qdox.model.JavaMethod;
+import com.thoughtworks.qdox.model.Type;
+
 /**
  * Maven goal to generate java source code for Component classes.
  * 
@@ -215,6 +225,19 @@
         // is added to compilation source path 
         //project.addCompileSourceRoot(generatedSourceDirectory.getCanonicalPath());
         
+        //Init Qdox for extract code 
+        JavaDocBuilder builder = new JavaDocBuilder();
+        
+        List sourceDirs = project.getCompileSourceRoots();
+        
+        // need a File object representing the original source tree
+        for (Iterator i = sourceDirs.iterator(); i.hasNext();)
+        {
+            String srcDir = (String) i.next();
+            builder.addSourceTree(new File(srcDir));
+        }        
+        
+        //Init velocity
         VelocityEngine velocityEngine = initVelocity();
 
         VelocityContext baseContext = new VelocityContext();
@@ -232,7 +255,7 @@
                 if (!f.exists() && canGenerateComponent(component))
                 {                
                     log.info("Generating component class:"+component.getClassName());
-                    _generateComponent(velocityEngine, component,baseContext);
+                    _generateComponent(velocityEngine, builder,component,baseContext);
                 }
             }
         }        
@@ -297,12 +320,31 @@
      * @param component
      *            the parsed component metadata
      */
-    private void _generateComponent(VelocityEngine velocityEngine, ComponentMeta component, VelocityContext baseContext)
+    private void _generateComponent(VelocityEngine velocityEngine,
+            JavaDocBuilder builder,
+            ComponentMeta component, VelocityContext baseContext)
             throws MojoExecutionException
     {
         Context context = new VelocityContext(baseContext);
         context.put("component", component);
 
+        //Part of the content source in the source class should be
+        //included only if this class is not its parent class and is
+        //not the same class (class outside the hierarchy).
+        //One example of why is useful do this is in 
+        //javax.faces.component.HtmlDataTable (myfaces 1.1),
+        //in this class it is overriden encodeBegin.
+        if (!component.getClassSource().equals(component.getClassName()) &&
+            !component.getClassSource().equals(component.getParentClassName()))
+        {
+            String source = this.getInnerSourceCode(builder, component);
+            
+            if (source != null && !"".equals(source))
+            {
+                context.put("innersource", source);
+            }
+        }        
+        
         Writer writer = null;
         File outFile = null;
 
@@ -335,7 +377,133 @@
             writer = null;
         }
     }
+        
+    /**
+     * This method extract from component scanned sourceClass, the parts
+     * which we need to move to generated class as a single String using Qdox.
+     * 
+     * Ignore code that has a \@JSFExclude or \@JSFProperty Doclet or Annotation
+     * 
+     * @param component
+     * @return
+     */
+    private String getInnerSourceCode(JavaDocBuilder builder, ComponentMeta component)
+    {   
+        StringWriter writer = new StringWriter();
+        
+        JavaClass sourceClass = builder.getClassByName(component.getClassSource());
+        
+        JavaField [] fields = sourceClass.getFields();
 
+        //Include the fields defined
+        for (int i = 0; i < fields.length; i++)
+        {            
+            JavaField field = fields[i];
+            
+            DocletTag tag = field.getTagByName("JSFExclude");
+            Annotation anno = getAnnotation(field, "JSFExclude");
+            
+            if (!(tag == null && anno == null))
+                continue;
+                        
+            if (!isExcludedField(field.getName()))
+            {
+                writer.append("    ");
+                writer.append(field.getDeclarationSignature(true));
+                writer.append(';');
+                writer.append('\n');
+                writer.append('\n');
+            }
+        }
+        
+        JavaMethod [] methods = sourceClass.getMethods();
+        for (int i = 0; i < methods.length; i++)
+        {
+            JavaMethod method = methods[i];
+
+            DocletTag tag = method.getTagByName("JSFExclude");
+            Annotation anno = getAnnotation(method, "JSFExclude");
+            
+            if (!(tag == null && anno == null))
+                continue;
+            
+            tag = method.getTagByName("JSFProperty", false);
+            anno = getAnnotation(method, "JSFProperty");
+            
+            if (tag == null && anno == null)
+            {              
+                //Get declaration signature in a way that we don't need
+                //to declare imports.
+                String declaration = method.getDeclarationSignature(true);
+                
+                //Fix for qdox 1.6.3: remove code 
+                int index = declaration.indexOf(')');
+                if (index != -1){
+                    declaration = declaration.substring(0,index+1);
+                }
+                
+                //Append exception in full form
+                Type [] exceptions = method.getExceptions();
+                if (exceptions != null && exceptions.length != 0)
+                {
+                    declaration = declaration + " throws ";                    
+                    for (int j = 0; j < exceptions.length; j++)
+                    {
+                        declaration = declaration + exceptions[i].getJavaClass().getFullyQualifiedName();
+                    }
+                }
+                
+                writer.append("    ");
+                writer.append(declaration);
+                writer.append('\n');
+                writer.append("    ");
+                writer.append('{');
+                writer.append(method.getSourceCode());
+                writer.append('}');
+                writer.append('\n');
+                writer.append('\n');
+            }            
+        }
+                
+        return writer.toString();
+    }
+    
+    private boolean isExcludedField(String name)
+    {
+        return (name.equals("COMPONENT_TYPE") || 
+                name.equals("DEFAULT_RENDERER_TYPE") ||
+                name.equals("COMPONENT_FAMILY") );
+    }
+    
+    private Annotation getAnnotation(AbstractJavaEntity entity, String annoName)
+    {
+        Annotation[] annos = entity.getAnnotations();
+        if (annos == null)
+        {
+            return null;
+        }
+        // String wanted = ANNOTATION_BASE + "." + annoName;
+        for (int i = 0; i < annos.length; ++i)
+        {
+            Annotation thisAnno = annos[i];
+            // Ideally, here we would check whether the fully-qualified name of
+            // the annotation
+            // class matches ANNOTATION_BASE + "." + annoName. However it
+            // appears that qdox 1.6.3
+            // does not correctly expand @Foo using the class import statements;
+            // method
+            // Annotation.getType.getJavaClass.getFullyQualifiedName still just
+            // returns the short
+            // class name. So for now, just check for the short name.
+            String thisAnnoName = thisAnno.getType().getJavaClass().getName();
+            if (thisAnnoName.equals(annoName))
+            {
+                return thisAnno;
+            }
+        }
+        return null;
+    }
+    
     private String _getTemplateName(){
         if (templateComponentName != null){
             if (_is12()){

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ClassMeta.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ClassMeta.java?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ClassMeta.java (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ClassMeta.java Thu Apr 24 20:52:58 2008
@@ -39,6 +39,7 @@
     private String _parentClassName;
     private List _interfaceClassNames = new ArrayList();
     private String _modelId;
+    private String _classSource;
 
     /**
      * Write this model out as xml.
@@ -48,6 +49,7 @@
         out.writeElement("className", mi._className);
         out.writeElement("parentClassName", mi._parentClassName);
         out.writeElement("modelId", mi._modelId);
+        out.writeElement("classSource", mi._classSource);
 
         if (!mi._interfaceClassNames.isEmpty())
         {
@@ -71,6 +73,7 @@
     {
         digester.addBeanPropertySetter(prefix + "/className");
         digester.addBeanPropertySetter(prefix + "/parentClassName");
+        digester.addBeanPropertySetter(prefix + "/classSource");
         digester.addBeanPropertySetter(prefix + "/modelId");
         digester.addCallMethod(prefix + "/interfaces/interface",
                 "addInterfaceClassName", 1);
@@ -144,5 +147,15 @@
     public String getPackageName()
     {
         return StringUtils.substring(getClassName(), 0, StringUtils.lastIndexOf(getClassName(), '.'));
+    }
+
+    public void setClassSource(String classSource)
+    {
+        this._classSource = classSource;
+    }
+
+    public String getClassSource()
+    {
+        return _classSource;
     }
 }

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java Thu Apr 24 20:52:58 2008
@@ -446,6 +446,7 @@
         converter.setName(componentName);
         converter.setBodyContent(bodyContent);
         converter.setTagClass(tagClass);
+        converter.setClassSource(clazz.getFullyQualifiedName());
         converter.setClassName(converterClass);
         converter.setConverterId(converterId);
         converter.setDescription(shortDescription);
@@ -488,6 +489,7 @@
         validator.setName(componentName);
         validator.setBodyContent(bodyContent);
         validator.setTagClass(tagClass);
+        validator.setClassSource(clazz.getFullyQualifiedName());
         validator.setClassName(validatorClass);
         validator.setValidatorId(validatorId);
         validator.setDescription(shortDescription);
@@ -662,6 +664,7 @@
         component.setName(componentName);
         component.setBodyContent(bodyContent);
         component.setClassName(componentClass);
+        component.setClassSource(clazz.getFullyQualifiedName());
         component.setParentClassName(componentParentClass);
         component.setDescription(shortDescription);
         component.setLongDescription(longDescription);

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile-flat.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile-flat.xml?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile-flat.xml (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile-flat.xml Thu Apr 24 20:52:58 2008
@@ -3,6 +3,7 @@
 <model>
   <component>
     <className>ComponentBase</className>
+    <classSource>ComponentBase</classSource>
     <type>base</type>
     <family>base</family>
     <rendererType>BaseRenderer</rendererType>
@@ -30,6 +31,7 @@
   </component>
   <component>
     <className>ComponentInterface</className>
+    <classSource>ComponentInterface</classSource>
     <type>iface</type>
     <family>iface</family>
     <rendererType>BaseRenderer</rendererType>
@@ -57,6 +59,7 @@
   <component>
     <className>ComponentChild</className>
     <parentClassName>ComponentBase</parentClassName>
+    <classSource>ComponentChild</classSource>
     <interfaces>
       <interface name="ComponentInterface"/>
     </interfaces>
@@ -114,6 +117,7 @@
   </component>
   <converter>
     <className>Converter1</className>
+    <classSource>Converter1</classSource>
     <converterId>conv1</converterId>
     <desc>The Converter1 converter</desc>
     <longDesc>
@@ -126,6 +130,7 @@
   </converter>
   <validator>
     <className>Validator1</className>
+    <classSource>Validator1</classSource>
     <validatorId>val1</validatorId>
     <desc>The Validator1 validator</desc>
     <longDesc>

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile.xml?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile.xml (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/complex/goodfile.xml Thu Apr 24 20:52:58 2008
@@ -3,6 +3,7 @@
 <model>
   <component>
     <className>ComponentBase</className>
+    <classSource>ComponentBase</classSource>
     <type>base</type>
     <family>base</family>
     <rendererType>BaseRenderer</rendererType>
@@ -30,6 +31,7 @@
   </component>
   <component>
     <className>ComponentInterface</className>
+    <classSource>ComponentInterface</classSource>
     <type>iface</type>
     <family>iface</family>
     <rendererType>BaseRenderer</rendererType>
@@ -57,6 +59,7 @@
   <component>
     <className>ComponentChild</className>
     <parentClassName>ComponentBase</parentClassName>
+    <classSource>ComponentChild</classSource>
     <interfaces>
       <interface name="ComponentInterface"/>
     </interfaces>
@@ -87,6 +90,7 @@
   </component>
   <converter>
     <className>Converter1</className>
+    <classSource>Converter1</classSource>
     <converterId>conv1</converterId>
     <desc>The Converter1 converter</desc>
     <longDesc>
@@ -99,6 +103,7 @@
   </converter>
   <validator>
     <className>Validator1</className>
+    <classSource>Validator1</classSource>
     <validatorId>val1</validatorId>
     <desc>The Validator1 validator</desc>
     <longDesc>

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple/goodfile.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple/goodfile.xml?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple/goodfile.xml (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple/goodfile.xml Thu Apr 24 20:52:58 2008
@@ -3,6 +3,7 @@
 <model>
   <component>
     <className>Foo</className>
+    <classSource>Foo</classSource>
     <name>foo</name>
     <type>foo</type>
     <family>foo</family>
@@ -28,4 +29,4 @@
       </longDesc>
     </property>
   </component>
-</model>
\ No newline at end of file
+</model>

Modified: myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple15/goodfile.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple15/goodfile.xml?rev=651482&r1=651481&r2=651482&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple15/goodfile.xml (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/myfaces-builder-plugin/src/test/resources/builder/simple15/goodfile.xml Thu Apr 24 20:52:58 2008
@@ -3,6 +3,7 @@
 <model>
   <component>
     <className>Foo</className>
+    <classSource>Foo</classSource>
     <name>foo</name>
     <type>foo</type>
     <family>foo</family>
@@ -28,4 +29,4 @@
       </longDesc>
     </property>
   </component>
-</model>
\ No newline at end of file
+</model>