1 20 21 22 package com.fredck.FCKeditor; 23 24 import java.util.*; 25 26 32 public class FCKeditorConfigurations extends HashMap{ 33 34 37 public FCKeditorConfigurations() { 38 super(); 39 } 40 41 47 public String getUrlParams() { 48 StringBuffer osParams = new StringBuffer (); 49 50 for(Iterator i=this.entrySet().iterator();i.hasNext();) { 51 Map.Entry entry = (Map.Entry) i.next(); 52 if(entry.getValue()!=null) 53 osParams.append("&"+encodeConfig(entry.getKey().toString())+"="+encodeConfig(entry.getValue().toString())); 54 } 55 return osParams.toString(); 56 } 57 58 private String encodeConfig(String txt) { 59 txt=txt.replaceAll("&","%26"); 60 txt=txt.replaceAll("=","%3D"); 61 txt=txt.replaceAll("\"","%22"); 62 return txt; 63 } 64 65 } 66 | Popular Tags |