Esempio n. 1
0
 /**
  * ** Returns a String representation of all key/values ** @param sbuff The StringBuffer to write
  * the key/values to, or null ** for a new one ** @return A String representation of all
  * key/values
  */
 public StringBuffer getArgString(StringBuffer sbuff) {
   StringBuffer sb = (sbuff != null) ? sbuff : new StringBuffer();
   for (Iterator i = this.getKeyValList().iterator(); i.hasNext(); ) {
     KeyVal kv = (KeyVal) i.next();
     sb.append(kv.toString());
     if (i.hasNext()) {
       sb.append("&");
     }
   }
   return sb;
 }
Esempio n. 2
0
 /**
  * ** Returns a String representation of all key/values ** @param sbuff The StringBuffer to write
  * the key/values to, or null for a new one ** @param includeBlankValues True to include keys for
  * blank values. ** @return A String representation of all key/values
  */
 public StringBuffer getArgString(StringBuffer sbuff, boolean includeBlankValues) {
   StringBuffer sb = (sbuff != null) ? sbuff : new StringBuffer();
   int argCnt = 0;
   for (Iterator i = this.getKeyValList().iterator(); i.hasNext(); ) {
     KeyVal kv = (KeyVal) i.next();
     if (includeBlankValues || kv.hasValue()) {
       if (argCnt > 0) {
         sb.append("&");
       }
       sb.append(kv.toString());
       argCnt++;
     }
   }
   return sb;
 }