dgraham 2003/08/11 16:50:31
Modified: validator/src/share/org/apache/commons/validator Field.java
validator/conf/share validator_1_1.dtd
Log:
Made <msg> attributes "name" and "key" required and removed
unneeded checking in Field.addMsg(). A <msg> element without name
and key is meaningless. Also, fixed a copy-paste error in <arg>
ATTLIST.
Revision Changes Path
1.21 +6 -13
jakarta-commons/validator/src/share/org/apache/commons/validator/Field.java
Index: Field.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Field.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Field.java 3 Aug 2003 17:29:40 -0000 1.20
+++ Field.java 11 Aug 2003 23:50:31 -0000 1.21
@@ -274,21 +274,14 @@
* Add a <code>Msg</code> to the <code>Field</code>.
*/
public void addMsg(Msg msg) {
- if (msg != null
- && msg.getKey() != null
- && msg.getKey().length() > 0
- && msg.getName() != null
- && msg.getName().length() > 0) {
-
- hMsgs.put(msg.getName(), msg.getKey());
- }
+ hMsgs.put(msg.getName(), msg.getKey());
}
/**
* Retrieve a message value.
*/
public String getMsg(String key) {
- return (String)hMsgs.get(key);
+ return (String) hMsgs.get(key);
}
/**
1.5 +7 -7 jakarta-commons/validator/conf/share/validator_1_1.dtd
Index: validator_1_1.dtd
===================================================================
RCS file: /home/cvs/jakarta-commons/validator/conf/share/validator_1_1.dtd,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- validator_1_1.dtd 3 Aug 2003 17:43:17 -0000 1.4
+++ validator_1_1.dtd 11 Aug 2003 23:50:31 -0000 1.5
@@ -1,13 +1,13 @@
<!--
- DTD for the Validator Rules Configuration File, Version 1.0.1
+ DTD for the Validator Rules Configuration File, Version 1.1
To allow for XML validation of your rules configuration
file, include the following DOCTYPE element at the beginning (after
the "xml" declaration):
<!DOCTYPE form-validation PUBLIC
- "-//Apache Software Foundation//DTD Commons Validator Rules Configuration
1.0.1//EN"
- "http://jakarta.apache.org/commons/dtds/validator_1_0_1.dtd">
+ "-//Apache Software Foundation//DTD Commons Validator Rules Configuration
1.1//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
$Id$
-->
@@ -137,9 +137,9 @@
[true]
-->
<!ELEMENT msg EMPTY>
+<!ATTLIST msg key CDATA #REQUIRED>
+<!ATTLIST msg name CDATA #REQUIRED>
<!ATTLIST msg bundle CDATA #IMPLIED>
-<!ATTLIST msg name CDATA #IMPLIED>
-<!ATTLIST msg key CDATA #IMPLIED>
<!ATTLIST msg resource CDATA #IMPLIED>
@@ -168,7 +168,7 @@
-->
<!ELEMENT arg EMPTY>
<!ATTLIST arg key CDATA #REQUIRED>
-<!ATTLIST msg bundle CDATA #IMPLIED>
+<!ATTLIST arg bundle CDATA #IMPLIED>
<!ATTLIST arg name CDATA #IMPLIED>
<!ATTLIST arg resource CDATA #IMPLIED>
<!ATTLIST arg position CDATA #IMPLIED>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]