henning 01/11/15 07:41:26
Modified: src/java/org/apache/turbine/services/intake IntakeTool.java
Log:
Adding some comments what mapTo() and getDefault() do
and how to actually use them.
Revision Changes Path
1.3 +24 -1
jakarta-turbine-2/src/java/org/apache/turbine/services/intake/IntakeTool.java
Index: IntakeTool.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/intake/IntakeTool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IntakeTool.java 2001/10/09 14:14:29 1.2
+++ IntakeTool.java 2001/11/15 15:41:26 1.3
@@ -72,7 +72,7 @@
* A Pull tool to make intake objects available to a template
*
* @author <a href="mailto:[EMAIL PROTECTED]">John D. McNally</a>
- * @version $Id: IntakeTool.java,v 1.2 2001/10/09 14:14:29 henning Exp $
+ * @version $Id: IntakeTool.java,v 1.3 2001/11/15 15:41:26 henning Exp $
*/
public class IntakeTool
implements ApplicationTool, Recyclable
@@ -230,6 +230,12 @@
this.groupName = groupName;
}
+ /**
+ * populates the object with the default values from the XML File
+ *
+ * @return a Group object with the default values
+ */
+
public Group getDefault()
throws Exception
{
@@ -262,6 +268,23 @@
return g;
}
+
+ /**
+ * maps an object to the values from a Retrievable object.
+ *
+ * If you supply null as the object, it returns the defaults, thus making
this superflous:
+ *
+ * #if($!mapobj)
+ * #set ($frm = $intake.myGroup.mapTo($mapobj))
+ * #else
+ * #set ($frm = $intake.myGroup.default)
+ * #end
+ *
+ * @param obj A retrievable object
+ *
+ * @return an Intake Group
+ *
+ */
public Group mapTo(Retrievable obj)
throws Exception
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>