myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r776150 - in /myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF: facelets-taglib.vm tagClass12.vm trinidad-faces-config12.vm trinidad-tld12.vm trinidadComponentClass12.vm trinidadTagClass12.vm
Date Tue, 19 May 2009 02:45:52 GMT
Author: lu4242
Date: Tue May 19 02:45:51 2009
New Revision: 776150

URL: http://svn.apache.org/viewvc?rev=776150&view=rev
Log:
update templates to keep in sync with tomahawk templates and add new trinidad templates

Added:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-faces-config12.vm
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-tld12.vm
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadComponentClass12.vm
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadTagClass12.vm
Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib.vm
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/tagClass12.vm

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib.vm?rev=776150&r1=776149&r2=776150&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib.vm
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib.vm
Tue May 19 02:45:51 2009
@@ -29,6 +29,7 @@
 #if ($modelIds.contains($component.modelId) 
     && ($component.name))
 #if (!$component.isConfigExcluded())
+#if ($utils.getTagPrefix($component.name) == $shortname)
     <tag>
         <tag-name>$utils.getTagName($component.name)</tag-name>
         <component>
@@ -46,13 +47,15 @@
 #end
 #end
 #end
+#end
 
    <!-- Converter tags -->
 #set ($componentList = ${model.getConverters()})
 #foreach( $component in $componentList )
 #if ($modelIds.contains($component.modelId) 
     && ($component.name))
-#if ($component.converterId) 
+#if ($component.converterId)
+#if ($utils.getTagPrefix($component.name) == $shortname) 
     <tag>
         <tag-name>$utils.getTagName($component.name)</tag-name>
         <converter>
@@ -62,6 +65,7 @@
 #end
 #end
 #end
+#end
 
    <!-- Validator tags -->
 #set ($componentList = ${model.getValidators()})
@@ -69,6 +73,7 @@
 #if ($modelIds.contains($component.modelId) 
     && ($component.name))
 #if ($component.validatorId)
+#if ($utils.getTagPrefix($component.name) == $shortname)
     <tag>
         <tag-name>$utils.getTagName($component.name)</tag-name>
         <validator>
@@ -78,12 +83,14 @@
 #end
 #end
 #end
+#end
     
    <!-- Single Tags -->
 #set ($tagList = $model.getTags())
 #foreach( $tag in $tagList )
 #if ($modelIds.contains($tag.modelId))
 #if ($tag.tagHandler)
+#if ($utils.getTagPrefix($tag.name) == $shortname)
    <tag>
       <tag-name>$utils.getTagName($tag.name)</tag-name>
       <handler-class>$tag.tagHandler</handler-class>
@@ -91,5 +98,6 @@
 #end
 #end
 #end
+#end
 
-</facelet-taglib>
\ No newline at end of file
+</facelet-taglib>

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/tagClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/tagClass12.vm?rev=776150&r1=776149&r2=776150&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/tagClass12.vm
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/tagClass12.vm
Tue May 19 02:45:51 2009
@@ -63,7 +63,9 @@
 #foreach( $property in $propertyList )
 #set ($field = $property.fieldName)
 #set ($type = $utils.getJspPropertyType12($property))
- 
+#if ($property.isLiteralOnly() && $property.className == "boolean")
+#set ($type = "String")
+#end
     private $type $field;
     
 #set ($var = $utils.getVariableFromName($property.name))
@@ -90,6 +92,9 @@
 #foreach( $property in $propertyList )##            1
 #set ($field = $property.fieldName)
 #set ($type = $utils.getJspPropertyType12($property))
+#if ($property.isLiteralOnly() && $property.className == "boolean")
+#set ($type = "String")
+#end
 #if ($utils.isConverter($property.className))##                   2
         if ($field != null)
         {
@@ -149,7 +154,11 @@
         if ($field != null)
         {
 #if ($property.isLiteralOnly())##                         3
+#if ($utils.isPrimitiveClass($property.className))##               4
+            comp.getAttributes().put("$property.name", ${utils.getBoxedClass($property.className)}.valueOf($field));
+#else##                                                   4
             comp.getAttributes().put("$property.name", $field);
+#end##                                                    4
 #else##                                                 3
             comp.setValueExpression("$property.name", $field);
 #end##                                                  3
@@ -163,11 +172,7 @@
         super.release();
 #foreach( $property in $propertyList )
 #set ($field = $property.fieldName)
-#if($utils.getJspPropertyType12($property) == "boolean")
-#set ($empty = "false")
-#else
 #set ($empty = "null")
-#end
         $field = $empty;
 #end
     }

Added: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-faces-config12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-faces-config12.vm?rev=776150&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-faces-config12.vm
(added)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-faces-config12.vm
Tue May 19 02:45:51 2009
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ * 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.
+-->
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"

+              version="1.2">
+
+$baseContent
+
+#set ($componentList = ${model.getComponents()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+    && !($component.isConfigExcluded()))
+  <component>
+#if ($component.longDescription)
+    <description><![CDATA[$component.longDescription]]></description>
+#end    
+    <component-type>$component.type</component-type>
+    <component-class>$component.className</component-class>
+#set ($facetList = ${component.facetList})
+#foreach( $facet in $facetList )
+    <facet>
+#if ($facet.longDescription)
+        <description><![CDATA[$facet.longDescription]]></description>
+#end
+        <facet-name>$facet.name</facet-name>
+    </facet>
+#end
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+## Theorically, it should only add properties visible on tld or transient
+## (not visible on tld but used on renderers like "transient").
+## On myfaces core 1.2, only "transient" property use it.
+## But inclusive, some tagExcluded properties belongs to the
+## component class or are used by some reason (for example in UIInput 
+## valid, localValueSet or submittedValue).
+## Anyway, this information works only as metadata.
+#if (!$property.name.equals("binding"))  ## binding is used only in tag class or tag handler
+## !$property.isTagExcluded() || $property.isTransient()
+#if ( true )
+    <property>
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#end
+         <property-name>$property.name</property-name>
+         <property-class>$property.className</property-class>
+#if($utils.getDefaultValueField($property))
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#if ($defaultValue.charAt(0) == '"')
+#set ($dVsize = $defaultValue.length() - 1)
+#set ($defaultValue = $defaultValue.substring(1,$dVsize) ) 
+#end
+         <default-value>$defaultValue</default-value>
+#end
+    </property>
+#end
+#end
+#end
+##    <component-extension>
+##      <component-family>$component.family</component-family>
+###if ($component.rendererType)
+###if (!($component.rendererType == ""))
+##      <renderer-type>$component.rendererType</renderer-type>
+###end
+###end
+##    </component-extension>
+  </component>    
+#end
+#end
+#set ($converterList = ${model.getConverters()})
+#foreach( $converter in $converterList )
+#if ($modelIds.contains($converter.modelId)
+    && !($converter.isConfigExcluded()))
+  <converter>
+#if ($converter.longDescription)
+    <description><![CDATA[$converter.longDescription]]></description>
+#end    
+    <converter-id>$converter.converterId</converter-id>
+    <converter-class>$converter.className</converter-class>
+#set ($propertyList = ${converter.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.name.equals("binding"))  ## binding is used only in tag class or tag handler
+    <property>
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#end
+         <property-name>$property.name</property-name>
+         <property-class>$property.className</property-class>
+#if($utils.getDefaultValueField($property))
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#if ($defaultValue.charAt(0) == '"')
+#set ($dVsize = $defaultValue.length() - 1)
+#set ($defaultValue = $defaultValue.substring(1,$dVsize) ) 
+#end
+         <default-value>$defaultValue</default-value>
+#end
+    </property>
+#end
+#end
+  </converter>
+#end
+#end
+#set ($validatorList = ${model.getValidators()})
+#foreach( $validator in $validatorList )
+#if ($modelIds.contains($validator.modelId) &&
+    !($validator.isConfigExcluded().booleanValue()) &&
+    $validator.validatorId)
+  <validator>
+#if ($validator.longDescription)
+    <description><![CDATA[$validator.longDescription]]></description>
+#end
+#if ($validator.name)
+   <display-name>$utils.getTagName($validator.name)</display-name>
+#end
+    <validator-id>$validator.validatorId</validator-id>
+    <validator-class>$validator.className</validator-class>
+#set ($propertyList = ${validator.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.name.equals("binding"))  ## binding is used only in tag class or tag handler
+    <property>
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#end
+         <property-name>$property.name</property-name>
+         <property-class>$property.className</property-class>
+#if($utils.getDefaultValueField($property))
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#if ($defaultValue.charAt(0) == '"')
+#set ($dVsize = $defaultValue.length() - 1)
+#set ($defaultValue = $defaultValue.substring(1,$dVsize) ) 
+#end
+         <default-value>$defaultValue</default-value>
+#end
+    </property>
+#end
+#end
+  </validator>
+#end
+#end
+#set ($renderKitList = ${model.getRenderKits()})
+#foreach( $renderKit in $renderKitList )
+  <render-kit>
+    <render-kit-id>$renderKit.renderKitId</render-kit-id>
+#if ($renderKit.className)
+    <render-kit-class>$renderKit.className</render-kit-class>
+#end
+#set ($rendererList = ${renderKit.getRenderers()})
+#foreach( $renderer in $rendererList )
+      <renderer>
+        <component-family>$renderer.componentFamily</component-family>
+        <renderer-type>$renderer.rendererType</renderer-type>
+        <renderer-class>$renderer.className</renderer-class>
+      </renderer>
+#end
+  </render-kit>
+#end
+</faces-config>

Added: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-tld12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-tld12.vm?rev=776150&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-tld12.vm
(added)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidad-tld12.vm
Tue May 19 02:45:51 2009
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * 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.
+-->
+<taglib xmlns="http://java.sun.com/xml/ns/javaee" 
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"

+        version="2.1">
+   <!--
+   <tlib-version>$version</tlib-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.jspName</name>
+#if ($property.isRequired())
+         <required>$property.isRequired()</required>
+#end
+#if ($property.isMethodExpression() || $property.isMethodBinding())
+#if ($property.getMethodBindingSignature())
+        <deferred-method>
+#set ($sig = $property.getMethodBindingSignature())
+            <method-signature>$sig.returnType myMethod(${sig.parameterTypesAsString})</method-signature>
+
+        </deferred-method>
+#else
+## This is a very special case. If a property is MethodBinding or MethodExpression
+## this should have a signature. If not, for allow multiple MethodBinding
+## simulate a ValueExpression and write a custom code like in 
+## org.apache.myfaces.custom.suggestajax.AbstractSuggestAjaxTag
+         <deferred-value/>
+#end
+#elseif ($property.isLiteralOnly())
+         <rtexprvalue>false</rtexprvalue>
+#else
+#if ( "$!property.isRtexprvalue()" == "")
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if ($type == "String" || $type == "String[]" || $type == "Object" || $type == "List" ||
$type == "Date" || $type == "RowKeySet" || $type == "int[]")
+         <deferred-value></deferred-value>
+#else
+         <deferred-value>
+             <type>$property.className</type>
+         </deferred-value>
+#end
+#else
+         <rtexprvalue>$property.isRtexprvalue().booleanValue()</rtexprvalue>
+#end
+#end
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#else
+         <description><![CDATA[]]></description>
+#end
+      </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
+#if ($component.longDescription)
+      <description><![CDATA[$component.longDescription]]></description>
+#end
+
+      <attribute>
+        <name>id</name>
+      </attribute>
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+      <attribute>
+         <name>$property.name</name>
+#if ($property.isRequired())
+         <required>$property.isRequired()</required>
+#end
+#if ($property.isLiteralOnly())
+         <rtexprvalue>false</rtexprvalue>
+#else
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if ($type == "String" || $type == "String[]" || $type == "Object" || $type == "List" ||
$type == "Date" || $type == "RowKeySet" || $type == "int[]" || $type == "Locale" || $type
== "TimeZone")
+         <deferred-value></deferred-value>
+#else
+         <deferred-value>
+             <type>$property.className</type>
+         </deferred-value>
+#end
+#end
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#else
+         <description><![CDATA[]]></description>
+#end
+      </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>
+      
+      <attribute>
+        <name>id</name>
+      </attribute>
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+      <attribute>
+         <name>$property.name</name>
+#if ($property.isRequired())
+         <required>$property.isRequired()</required>
+#end
+#if ($property.isLiteralOnly())
+         <rtexprvalue>false</rtexprvalue>
+#else
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if ($type == "String" || $type == "String[]" || $type == "Object" || $type == "List" ||
$type == "Date" || $type == "RowKeySet" || $type == "int[]" || $type == "DateListProvider")
+         <deferred-value></deferred-value>
+#else
+         <deferred-value>
+             <type>$property.className</type>
+         </deferred-value>
+#end
+#end
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#else
+         <description><![CDATA[]]></description>
+#end
+      </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>
+#if ($tag.longDescription)
+      <description><![CDATA[$tag.longDescription]]></description>
+#end
+#set ($attributeList = ${tag.attributeList})
+#foreach( $attribute in $attributeList )
+#if (!$attribute.isExclude().booleanValue())
+      <attribute>
+         <name>$attribute.name</name>
+#if ($attribute.isRequired())
+         <required>$attribute.isRequired()</required>
+#end
+#set ($type = $utils.getClassFromFullClass($attribute.className))
+#if ($type == "MethodExpression")
+        <deferred-method>
+          <method-signature>${attribute.deferredMethodSignature}</method-signature>
+        </deferred-method>
+#elseif ($type == "ValueExpression")
+         <deferred-value>#if($attribute.deferredValueType)$attribute.deferredValueType#end</deferred-value>
+#else
+         <rtexprvalue>$attribute.isRtexprvalue()</rtexprvalue>
+#if ($attribute.className)         
+         <type>$attribute.className</type>
+#else
+         <type>java.lang.String</type>
+#end
+#end
+#if ($property.longDescription)
+         <description><![CDATA[$property.longDescription]]></description>
+#else
+         <description><![CDATA[]]></description>
+#end
+      </attribute>
+#end
+#end
+   </tag>
+#end
+#end
+</taglib>

Added: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadComponentClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadComponentClass12.vm?rev=776150&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadComponentClass12.vm
(added)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadComponentClass12.vm
Tue May 19 02:45:51 2009
@@ -0,0 +1,210 @@
+## Velocity template used to generate trinidad JSF1.2-compatible component classes
+## from component meta-data.
+##
+## Note that there are two types of component generation:
+##  * "subclass mode" (use annotated class as a parent class)
+##  * "template mode" (use annotated class as a template)
+## This template file is used for both.
+##
+## Variable $component refers to a ComponentMeta object to process
+## Variable $utils refers to an instance of MyfacesUtils.
+##
+## When "template mode" is being used then variable $innersource
+## holds a String containing all the non-abstract functions defined
+## in the annotated class.
+##
+/*
+ *  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 ${component.packageName};
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+$utils.importTagClasses($component)
+
+import org.apache.myfaces.trinidad.bean.FacesBean;
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.util.ComponentUtils;
+
+#if ($component.isTemplate())
+#set ($generatedClassParent = $component.sourceClassParentClassName)
+#else
+#set ($generatedClassParent = $component.sourceClassName)
+#end
+// Generated from class ${component.sourceClassName}.
+//
+// WARNING: This file was automatically generated. Do not edit it directly,
+//          or you will lose your changes.
+public class ${utils.getClassFromFullClass($component.className)} extends $generatedClassParent
+#if ($component.implements)
+    implements $component.implements
+#end
+{
+#if ($component.serialuid)
+    private static final long serialVersionUID = ${component.serialuid}; 
+#end  
+
+    static public final FacesBean.Type TYPE = new FacesBean.Type(
+       ${generatedClassParent}.TYPE);
+#set ($propertyList = ${component.propertyComponentList})
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getClassFromFullClass($property.className))
+#set ($key = $utils.getConstantNameFromProperty($property.name , "_KEY"))
+##
+## CALCULATE DEFAULT VALUE
+##
+#if($utils.getDefaultValueField($property)) 
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#if ($defaultValue == "true")
+#set ($defaultValue = "Boolean.TRUE")
+#end
+#if ($defaultValue == "false")
+#set ($defaultValue = "Boolean.FALSE")
+#end
+#if ($type == "char")
+#set ($defaultValue = "'"+$defaultValue+"'")
+#end
+#else
+#set ($defaultValue = false)
+#end
+## CALCULATE CAPABILITIES
+#set ($caps = "")
+#set ($capsCount = 0)
+#if ($property.isMethodBinding() || $property.isLiteralOnly())
+#set ($capsCount = $capsCount + 1)
+#end
+#if ($property.isStateHolder())
+#set ($capsCount = $capsCount + 1)
+#end
+#if ($property.isTransient())
+#set ($capsCount = $capsCount + 1)
+#end
+#if ($property.isMethodBinding() || $property.isLiteralOnly())
+#set ($caps = $caps + "PropertyKey.CAP_NOT_BOUND")
+#if ($capsCount > 1)#set($capsCount = $capsCount - 1)#set($caps=$caps+" | ")#end
+#end
+#if ($property.isStateHolder())
+#set ($caps = $caps + "PropertyKey.CAP_STATE_HOLDER")
+#if ($capsCount > 1)#set($capsCount = $capsCount - 1)#set($caps=$caps+" | ")#end
+#end
+#if ($property.isTransient())
+#set ($caps = $caps + "PropertyKey.CAP_TRANSIENT")
+#if ($capsCount > 1)#set($capsCount = $capsCount - 1)#set($caps=$caps+" | ")#end
+#end
+## This template does not handle PropertyKey.CAP_LIST
+
+    static public final PropertyKey $key =
+        TYPE.registerKey(
+            "$property.name",#if($utils.isPrimitiveClass($type))${utils.getBoxedClass($type)}.class#{else}${type}.class#end
+#if($defaultValue),${defaultValue}#end
+#if ( !$caps.equals("")),${caps}#end);
+#end
+
+    static public final String COMPONENT_FAMILY =
+        "$component.family";
+    static public final String COMPONENT_TYPE =
+        "$component.type";
+##if ($component.rendererType)
+##if (!($component.rendererType == ""))
+##    static public final String DEFAULT_RENDERER_TYPE = 
+##        "$component.rendererType";
+##end
+##end
+
+#if ($innersource)
+    //BEGIN CODE COPIED FROM $component.sourceClassName 
+$innersource
+    //END CODE COPIED FROM $component.sourceClassName
+#end
+
+    public ${utils.getClassFromFullClass($component.className)}()
+    {
+#if ($component.rendererType)
+#if ($component.rendererType == "")
+        super(null);
+#else
+        super("$component.rendererType");
+#end
+#else
+        super(null);
+#end
+    }
+
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getClassFromFullClass($property.className))
+#set ($key = $utils.getConstantNameFromProperty($property.name , "_KEY"))
+
+    final public $type $utils.getMethodReaderFromProperty($property.name, $type)()
+    {
+#if ($utils.isPrimitiveClass($type))
+#if ($type == "char")
+        return ComponentUtils.resolveCharacter((Character) getProperty($key));
+#elseif ($type == "byte" || $type == "short")
+## There is no ComponentUtils remethod, so we just cast it.
+        return $utils.castIfNecessary($type) getProperty($key);
+#else
+        return ComponentUtils.resolve${utils.getBoxedClass($type)}(getProperty($key));
+#end
+#elseif ($type == "String" || $type == "Locale" || $type == "TimeZone")
+        return ComponentUtils.resolve${utils.getBoxedClass($type)}(getProperty($key));
+#else
+        return $utils.castIfNecessary($type) getProperty($key);
+#end
+    }
+
+    final public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
+    {
+#if ($utils.isPrimitiveClass($type))
+#if ($type == "boolean")
+        setProperty($key, $utils.getVariableFromName($property.name) ? Boolean.TRUE : Boolean.FALSE);
+#else
+        setProperty($key, ${utils.getBoxedClass($type)}.valueOf( $utils.getVariableFromName($property.name)
));
+#end
+#else
+        setProperty($key, $utils.getVariableFromName($property.name));
+#end
+    }
+#end
+
+    @Override    
+    public String getFamily()
+    {
+        return COMPONENT_FAMILY;
+    }
+
+    @Override
+    protected FacesBean.Type getBeanType()
+    {
+        return TYPE;
+    }
+    
+    public ${utils.getClassFromFullClass($component.className)}(String rendererType)
+    {
+      super(rendererType);
+    }
+  
+    static
+    {
+        TYPE.lock();
+    }
+}

Added: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadTagClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadTagClass12.vm?rev=776150&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadTagClass12.vm
(added)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/trinidadTagClass12.vm
Tue May 19 02:45:51 2009
@@ -0,0 +1,142 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+//          or you will lose your changes.
+/*
+ *  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 ${component.tagPackage};
+
+import javax.el.ValueExpression;
+import org.apache.myfaces.trinidad.bean.FacesBean;
+##$utils.importTagClasses12($component)
+#set ($addMeMb = false)
+#set ($addMe = false)
+#set ($propertyList = ${component.propertyTagList})
+#foreach( $property in $propertyList )
+#if ($property.isMethodExpression())
+#set ($addMe = true)
+#end
+#if ($property.isMethodBinding())
+#set ($addMeMb = true)
+#end
+#end
+#if ($addMe)
+import javax.el.MethodExpression;
+#end
+#if ($addMeMb)
+import org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding;
+#end
+
+// Generated from class ${component.sourceClassName}.
+//
+// WARNING: This file was automatically generated. Do not edit it directly,
+//          or you will lose your changes.
+public class $utils.getClassFromFullClass($component.tagClass)
+#if (${component.tagSuperclass})
+    extends ${component.tagSuperclass}
+#else
+    extends javax.faces.webapp.UIComponentTag
+#end
+{
+    public $utils.getClassFromFullClass($component.tagClass)()
+    {    
+    }
+    
+    public String getComponentType()
+    {
+#if ($component.type)
+        return "$component.type";
+#else
+        return null;
+#end
+    }
+
+    public String getRendererType()
+    {
+#if ($component.rendererType && !($component.rendererType == ""))
+        return "$component.rendererType";
+#else
+        return null;
+#end
+    }
+
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+#if ($property.isLiteralOnly() && $property.className == "boolean")
+#set ($type = "String")
+#end
+    private $type $field;
+    
+#set ($var = $utils.getVariableFromName($property.name))
+    public void $utils.getPrefixedPropertyName("set", $property.jspName)($type $var)
+    {
+        $field = $var;
+    }
+#end
+
+    @Override
+    protected void setProperties(
+      FacesBean bean)
+    {
+        super.setProperties(bean);
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getClassFromFullClass($property.className))
+#set ($key = $utils.getConstantNameFromProperty($property.name , "_KEY"))
+#if ($utils.isConverter($property.className))##                   2
+        if ($field != null)
+        {
+            if (!${field}.isLiteralText())
+            {
+                bean.setValueExpression(${component.className}.${key}, $field);
+            }
+            else
+            {
+                String s = ${field}.getExpressionString();
+                if (s != null)
+                {            
+                    Converter converter = getFacesContext().getApplication().createConverter(s);
+                    bean.setProperty(${component.className}.${key}, converter);
+                }
+            }
+        }
+#elseif ($property.isMethodExpression())
+        bean.setProperty(${component.className}.${key}, $field);
+#elseif ($property.isMethodBinding())
+        if ($field != null)
+            bean.setProperty(${component.className}.${key}, new MethodExpressionMethodBinding($field))
+#elseif ($property.isLiteralOnly())
+        bean.setProperty(${component.className}.${key}, $field);
+#elseif ($type == "String[]")
+        setStringArrayProperty(bean, ${component.className}.${key}, $field);
+#else
+        setProperty(bean, ${component.className}.${key}, $field);
+#end
+#end
+    }
+    
+    public void release()
+    {
+        super.release();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($empty = "null")
+        $field = $empty;
+#end
+    }
+}



Mime
View raw message