Author: skitching
Date: Sat Feb 12 03:12:17 2005
New Revision: 153494
URL: http://svn.apache.org/viewcvs?view=rev&rev=153494
Log:
Added constructor which passes the top object on stack by default.
Also improved javadoc
Modified:
jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/actions/CallParamFromStackAction.java
Modified:
jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/actions/CallParamFromStackAction.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/actions/CallParamFromStackAction.java?view=diff&r1=153493&r2=153494
==============================================================================
---
jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/actions/CallParamFromStackAction.java
(original)
+++
jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/actions/CallParamFromStackAction.java
Sat Feb 12 03:12:17 2005
@@ -30,6 +30,10 @@
/**
* Action which fetches an object from the digester object stack to use
* as a parameter for the target method invoked by a CallMethodRule.
+ * <p>
+ * Note that the object to be passed is selected from the stack
+ * at the time this action executes, not at the time that the
+ * associated CallMethodRule executes.
*/
public class CallParamFromStackAction extends AbstractAction {
@@ -49,10 +53,25 @@
// ---------------------------------------------------------
/**
- * Construct a "call parameter" rule that will pass the body text
- * of the matching xml element as the parameter value.
+ * Construct a "call parameter" rule that will pass the top object
+ * from the digester object stack as the parameter value.
+ */
+ public CallParamFromStackAction(int paramIndex) {
+ this(paramIndex, 0);
+ }
+
+ /**
+ * Construct a "call parameter" rule that will pass an object from
+ * the digester object stack as the parameter value.
+ * <p>
+ * A stack offset of 0 means the top (newest) object. Positive
+ * values count downward from the top of the stack. A stack offset
+ * of -1 means the root (oldest) object. Negative values count upward
+ * from the root of the stack.
*
- * @param paramIndex The zero-relative parameter number
+ * @param paramIndex The zero-relative parameter number.
+ * @param stackOffset is the location on the stack of the object to
+ * be passed.
*/
public CallParamFromStackAction(int paramIndex, int stackOffset) {
this.paramIndex = paramIndex;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]