- Timestamp:
- 2012-05-22T13:01:04+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r25571 r25635 28 28 import javax.xml.transform.TransformerFactory; 29 29 import javax.xml.transform.Transformer; 30 31 import java.io.Serializable; 30 32 import java.io.StringWriter; 31 33 import javax.xml.transform.stream.StreamResult; … … 299 301 } 300 302 301 public static HashMap extractParams(Element xml, boolean deep)303 public static HashMap<String, Serializable> extractParams(Element xml, boolean deep) 302 304 { 303 305 return extractParams(xml, deep, null); … … 308 310 * deep=true, extracts embedded params, otherwise just top level params 309 311 */ 310 public static HashMap extractParams(Element xml, boolean deep, String toFind)312 public static HashMap<String, Serializable> extractParams(Element xml, boolean deep, String toFind) 311 313 { 312 314 … … 326 328 params = xml.getChildNodes(); 327 329 } 328 HashMap param_map = new HashMap();330 HashMap<String, Serializable> param_map = new HashMap<String, Serializable>(); 329 331 for (int i = 0; i < params.getLength(); i++) 330 332 { … … 354 356 String namespace = name.substring(0, pos); 355 357 name = name.substring(pos + 1); 356 HashMap map = (HashMap) param_map.get(namespace);358 HashMap<String, String> map = (HashMap<String, String>) param_map.get(namespace); 357 359 if (map == null) 358 360 { 359 map = new HashMap ();361 map = new HashMap<String, String>(); 360 362 param_map.put(namespace, map); 361 363 } … … 669 671 } 670 672 671 public static HashMap getChildrenMap(Node n)672 { 673 674 HashMap map = new HashMap();673 public static HashMap<String, Node> getChildrenMap(Node n) 674 { 675 676 HashMap<String, Node> map = new HashMap<String, Node>(); 675 677 Node child = n.getFirstChild(); 676 678 while (child != null) … … 856 858 } 857 859 858 public static Element createParameterDescription2(Document owner, String id, String display_name, String type, String default_value, ArrayList option_ids, ArrayListoption_names)860 public static Element createParameterDescription2(Document owner, String id, String display_name, String type, String default_value, ArrayList<String> option_ids, ArrayList<String> option_names) 859 861 { 860 862 … … 872 874 { 873 875 Element e = owner.createElement(PARAM_OPTION_ELEM); 874 e.setAttribute(NAME_ATT, (String)option_ids.get(i));875 e.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, (String)option_names.get(i)));876 e.setAttribute(NAME_ATT, option_ids.get(i)); 877 e.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, option_names.get(i))); 876 878 p.appendChild(e); 877 879 }
Note:
See TracChangeset
for help on using the changeset viewer.