dwinterfeldt 02/03/16 16:20:50
Modified: validator/src/share/org/apache/commons/validator
FormSet.java ValidatorResources.java
Log:
Added a method so constants can be added from new constant element structure.
Revision Changes Path
1.5 +10 -0
jakarta-commons/validator/src/share/org/apache/commons/validator/FormSet.java
Index: FormSet.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/FormSet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FormSet.java 13 Mar 2002 05:39:32 -0000 1.4
+++ FormSet.java 17 Mar 2002 00:20:50 -0000 1.5
@@ -167,6 +167,16 @@
}
/**
+ * Add a <code>Constant</code> to the locale level.
+ */
+ public void addConstantParam(String name, String value) {
+ if (name != null && name.length() > 0 &&
+ value != null && value.length() > 0) {
+ hConstants.put(name, value);
+ }
+ }
+
+ /**
* Add a <code>Form</code> to the <code>FormSet</code>.
*/
public void addForm(Form f) {
1.5 +19 -4
jakarta-commons/validator/src/share/org/apache/commons/validator/ValidatorResources.java
Index: ValidatorResources.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/ValidatorResources.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ValidatorResources.java 13 Mar 2002 05:39:32 -0000 1.4
+++ ValidatorResources.java 17 Mar 2002 00:20:50 -0000 1.5
@@ -117,7 +117,7 @@
hFormSets.put(buildKey(fs), fs);
if (log.isInfoEnabled()) {
- log.info("ValidatorResources::put - " + fs.toString());
+ log.info("Adding FormSet '" + fs.toString() + "'.");
}
}
}
@@ -133,11 +133,25 @@
}
if (log.isInfoEnabled()) {
- log.info("ValidatorResources::addConstant - Add Global Constant: " +
c.getName() + "," + c.getValue());
+ log.info("Add Global Constant: " + c.getName() + "," + c.getValue());
}
}
/**
+ * Add a global constant to the resource.
+ */
+ public void addConstantParam(String name, String value) {
+ if (name != null && name.length() > 0 &&
+ value != null && value.length() > 0) {
+ hConstants.put(name, value);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Add Global Constant: " + name + "," + value);
+ }
+ }
+
+ /**
* <p>Add a <code>ValidatorAction</code> to the resource. It also creates an
instance
* of the class based on the <code>ValidatorAction</code>s classname and
retrieves
* the <code>Method</code> instance and sets them in the
<code>ValidatorAction</code>.</p>
@@ -153,7 +167,7 @@
hActions.put(va.getName(), va);
if (log.isInfoEnabled()) {
- log.info("ValidatorResources::addValidatorAction - Add ValidatorAction:
" + va.getName() + "," + va.getClassname());
+ log.info("Add ValidatorAction: " + va.getName() + "," +
va.getClassname());
}
}
}
@@ -273,7 +287,8 @@
/**
* <p>Process the <code>ValidatorResources</code> object. </p>
*
- * <p>Currently sets the <code>FastHashMap</code>s to the 'fast' mode.</p>
+ * <p>Currently sets the <code>FastHashMap</code>s to the 'fast'
+ * mode and call the processes all other resources.</p>
*/
public void process() {
hFormSets.setFast(true);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>