You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2009/11/16 21:29:06 UTC
svn commit: r880948 -
/tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java
Author: apetrelli
Date: Mon Nov 16 20:29:06 2009
New Revision: 880948
URL: http://svn.apache.org/viewvc?rev=880948&view=rev
Log:
TILES-486
Moved createTemplateAttribute method in the file and added javadocs.
Modified:
tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java
Modified: tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java?rev=880948&r1=880947&r2=880948&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java (original)
+++ tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java Mon Nov 16 20:29:06 2009
@@ -298,6 +298,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.
*
@@ -578,17 +604,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;
- }
}