skitching 2004/11/29 19:08:55
Modified: digester/src/java/org/apache/commons/digester
CallMethodRule.java CallParamRule.java
Log:
Added comments only, re behaviour when passing body of element and the
element is empty (empty string passed, not null).
Revision Changes Path
1.36 +10 -3
jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java
Index: CallMethodRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- CallMethodRule.java 10 May 2004 06:30:06 -0000 1.35
+++ CallMethodRule.java 30 Nov 2004 03:08:55 -0000 1.36
@@ -42,7 +42,7 @@
* This increases the kinds of methods successfully and allows primitives
* to be matched by passing in wrapper classes.
* There are rare cases when [EMAIL PROTECTED]
MethodUtils#invokeExactMethod}
- * (the old defualt) is required.
+ * (the old default) is required.
* This method is much stricter in it's reflection.
* Setting the <code>UseExactMatch</code> to true reverts to the use of this
* method.</p>
@@ -60,12 +60,19 @@
* not be invoked. If a CallMethodRule is expecting more than one parameter,
* then it is always invoked, regardless of whether the parameters were
* available or not (missing parameters are passed as null values).</p>
+ *
+ * <p>Note that when a constructor is used with paramCount=0, indicating that
+ * the body of the element is to be passed to the target method, an empty
+ * element will cause an <i>empty string</i> to be passed to the target
method,
+ * not null. And if automatic type conversion is being applied (ie if the
+ * target function takes something other than a string as a parameter) then
+ * the conversion will fail if the converter class does not accept an empty
+ * string as valid input.</p>
*/
public class CallMethodRule extends Rule {
// -----------------------------------------------------------
Constructors
-
/**
* Construct a "call method" rule with the specified method name. The
1.23 +13 -1
jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java
Index: CallParamRule.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- CallParamRule.java 9 Sep 2004 20:38:21 -0000 1.22
+++ CallParamRule.java 30 Nov 2004 03:08:55 -0000 1.23
@@ -51,6 +51,12 @@
* Construct a "call parameter" rule that will save the body text of this
* element as the parameter value.
*
+ * <p>Note that if the element is empty the an <i>empty string</i> is
+ * passed to the target method, not null. And if automatic type
conversion
+ * is being applied (ie if the target function takes something other
than
+ * a string as a parameter) then the conversion will fail if the
converter
+ * class does not accept an empty string as valid input.</p>
+ *
* @param digester The associated Digester
* @param paramIndex The zero-relative parameter number
*
@@ -85,6 +91,12 @@
/**
* Construct a "call parameter" rule that will save the body text of this
* element as the parameter value.
+ *
+ * <p>Note that if the element is empty the an <i>empty string</i> is
+ * passed to the target method, not null. And if automatic type
conversion
+ * is being applied (ie if the target function takes something other
than
+ * a string as a parameter) then the conversion will fail if the
converter
+ * class does not accept an empty string as valid input.</p>
*
* @param paramIndex The zero-relative parameter number
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]