jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r333024 - /jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/SelectOne.java
Date Sun, 13 Nov 2005 15:39:05 GMT
Author: rahul
Date: Sun Nov 13 07:39:02 2005
New Revision: 333024

URL: http://svn.apache.org/viewcvs?rev=333024&view=rev
Log:
1) Restore backward compatibility in rendering of option elements (change made last night
differed in the rendering of "accept" attribute).
2) Change attribute default values to empty string

Modified:
    jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/SelectOne.java

Modified: jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/SelectOne.java
URL: http://svn.apache.org/viewcvs/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/SelectOne.java?rev=333024&r1=333023&r2=333024&view=diff
==============================================================================
--- jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/SelectOne.java (original)
+++ jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/SelectOne.java Sun Nov 13
07:39:02 2005
@@ -125,7 +125,15 @@
      *
      */    
     public static class Options implements Serializable {
-        
+
+        // "accept" attribute values
+        public static final String ACCEPT_EXACT = "exact";
+        public static final String ACCEPT_APPROX = "approximate";
+
+        // Default attribute values
+        private static final String STR_EMPTY = "";
+
+        // Instance variables
         private List values;
         private List utterances;
         private List dtmfs;
@@ -149,7 +157,7 @@
          * @param option_utterance The utterance for this option
          */
         public void add(String option_utterance) {
-            add(null, option_utterance, null, false); 
+            add(STR_EMPTY, option_utterance, STR_EMPTY, false); 
         }
 
         /**
@@ -161,7 +169,7 @@
          *                           sought
          */
         public void add(String option_utterance, boolean option_approximate) {
-            add(null, option_utterance, null, option_approximate);
+            add(STR_EMPTY, option_utterance, STR_EMPTY, option_approximate);
         }
 
         /**
@@ -172,7 +180,7 @@
          * @param option_utterance The utterance for this option
          */
         public void add(String option_value, String option_utterance) {
-            add(option_value, option_utterance, null, false);
+            add(option_value, option_utterance, STR_EMPTY, false);
         }
 
         /**
@@ -186,7 +194,7 @@
          */
         public void add(String option_value, String option_utterance, 
                 boolean option_approximate) {
-            add(option_value, option_utterance, null, option_approximate);
+            add(option_value, option_utterance, STR_EMPTY, option_approximate);
         }
 
         /**
@@ -218,9 +226,9 @@
             utterances.add(option_utterance);
             dtmfs.add(option_dtmf);
             if (option_approximate == true) {
-                accepts.add("approximate");
+                accepts.add(ACCEPT_APPROX);
             } else {
-                accepts.add("exact");
+                accepts.add(ACCEPT_EXACT);
             }
         }
 
@@ -244,8 +252,8 @@
                     if (!RDCUtils.isStringEmpty(dtm)) {
                         buf.append(" dtmf=\"").append(dtm.trim()).append("\"");
                     }
-                    if (!RDCUtils.isStringEmpty(acc)) {
-                        buf.append(" accept=\"").append(acc.trim()).append("\"");
+                    if (ACCEPT_APPROX.equals(acc)) {
+                        buf.append(" accept=\"").append(acc).append("\"");
                     }
                     buf.append(">").append(utt.trim()).append("</option>");
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message