Ignore:
Timestamp:
2012-05-22T13:01:04+12:00 (12 years ago)
Author:
sjm84
Message:

Fixing Greenstone 3's use (or lack thereof) of generics, this was done automatically so we may want to change it over time. This change will also auto-format any files that have not already been formatted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java

    r25571 r25635  
    2828import javax.xml.transform.TransformerFactory;
    2929import javax.xml.transform.Transformer;
     30
     31import java.io.Serializable;
    3032import java.io.StringWriter;
    3133import javax.xml.transform.stream.StreamResult;
     
    299301    }
    300302
    301     public static HashMap extractParams(Element xml, boolean deep)
     303    public static HashMap<String, Serializable> extractParams(Element xml, boolean deep)
    302304    {
    303305        return extractParams(xml, deep, null);
     
    308310     * deep=true, extracts embedded params, otherwise just top level params
    309311     */
    310     public static HashMap extractParams(Element xml, boolean deep, String toFind)
     312    public static HashMap<String, Serializable> extractParams(Element xml, boolean deep, String toFind)
    311313    {
    312314
     
    326328            params = xml.getChildNodes();
    327329        }
    328         HashMap param_map = new HashMap();
     330        HashMap<String, Serializable> param_map = new HashMap<String, Serializable>();
    329331        for (int i = 0; i < params.getLength(); i++)
    330332        {
     
    354356                    String namespace = name.substring(0, pos);
    355357                    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);
    357359                    if (map == null)
    358360                    {
    359                         map = new HashMap();
     361                        map = new HashMap<String, String>();
    360362                        param_map.put(namespace, map);
    361363                    }
     
    669671    }
    670672
    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>();
    675677        Node child = n.getFirstChild();
    676678        while (child != null)
     
    856858    }
    857859
    858     public static Element createParameterDescription2(Document owner, String id, String display_name, String type, String default_value, ArrayList option_ids, ArrayList option_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)
    859861    {
    860862
     
    872874            {
    873875                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)));
    876878                p.appendChild(e);
    877879            }
Note: See TracChangeset for help on using the changeset viewer.