Author: apetrelli
Date: Mon Nov 16 20:32:47 2009
New Revision: 880950

URL: http://svn.apache.org/viewvc?rev=880950&view=rev
Log:
TILES-486
Merge from trunk to sandbox tiles3.
Moved createTemplateAttribute method in the file and added javadocs.

Modified:
    tiles/sandbox/trunk/tiles3/   (props changed)
    
tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/Attribute.java
    tiles/sandbox/trunk/tiles3/tiles-test-pom/tiles-test/   (props changed)
    
tiles/sandbox/trunk/tiles3/tiles-test-pom/tiles-test/src/main/webapp/WEB-INF/tools.xml
   (props changed)

Propchange: tiles/sandbox/trunk/tiles3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 20:32:47 2009
@@ -1 +1 @@
-/tiles/framework/trunk:829356,836356,880940
+/tiles/framework/trunk:829356,836356,880940,880948

Modified: 
tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/Attribute.java
URL: 
http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/Attribute.java?rev=880950&r1=880949&r2=880950&view=diff
==============================================================================
--- 
tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/Attribute.java
 (original)
+++ 
tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/Attribute.java
 Mon Nov 16 20:32:47 2009
@@ -141,6 +141,32 @@
     }
 
     /**
+     * Creates a template attribute, starting from the name of the template.
+     *
+     * @param template The template that will be rendered.
+     * @param templateExpression The template expression that will be evaluated
+     * to a template.
+     * @param templateType The type, or renderer, of the template. If null, the
+     * default <code>template</code> will be used.
+     * @param role The comma-separated roles for which the template is
+     * authorized to be rendered.
+     * @return The template attribute.
+     * @since 2.2.2
+     */
+    public static Attribute createTemplateAttribute(String template,
+            String templateExpression, String templateType, String role) {
+        Attribute templateAttribute = createTemplateAttribute(template);
+        templateAttribute.setRole(role);
+        if (templateType != null) {
+            templateAttribute.setRenderer(templateType);
+        }
+        templateAttribute
+                .setExpressionObject(Expression
+                        
.createExpressionFromDescribedExpression(templateExpression));
+        return templateAttribute;
+    }
+
+    /**
      * Creates a template attribute, starting from the expression to evaluate 
to
      * obtain the template.
      *
@@ -331,17 +357,4 @@
     public Attribute clone() {
         return new Attribute(this);
     }
-
-    public static Attribute createTemplateAttribute(String template,
-            String templateExpression, String templateType, String role) {
-        Attribute templateAttribute = createTemplateAttribute(template);
-        templateAttribute.setRole(role);
-        if (templateType != null) {
-            templateAttribute.setRenderer(templateType);
-        }
-        templateAttribute
-                .setExpressionObject(Expression
-                        
.createExpressionFromDescribedExpression(templateExpression));
-        return templateAttribute;
-    }
 }

Propchange: tiles/sandbox/trunk/tiles3/tiles-test-pom/tiles-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 20:32:47 2009
@@ -1,3 +1,3 @@
-/tiles/framework/trunk/tiles-test-pom/tiles-test:829356,836356,880940
+/tiles/framework/trunk/tiles-test-pom/tiles-test:829356,836356,880940,880948
 /tiles/sandbox/trunk/tiles-test:740289
 /tiles/sandbox/trunk/tiles-test-sandbox:740290-745038,747727-751891

Propchange: 
tiles/sandbox/trunk/tiles3/tiles-test-pom/tiles-test/src/main/webapp/WEB-INF/tools.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 20:32:47 2009
@@ -1 +1 @@
-/tiles/framework/trunk/tiles-test-pom/tiles-test/src/main/webapp/WEB-INF/tools.xml:829356,836356,880940
+/tiles/framework/trunk/tiles-test-pom/tiles-test/src/main/webapp/WEB-INF/tools.xml:829356,836356,880940,880948


Reply via email to