buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/VariableSet.java
changeset 628 7c4a911dc066
parent 588 c7c26511138f
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
    15 *
    15 *
    16 */
    16 */
    17  
    17  
    18 package com.nokia.helium.core.ant.types;
    18 package com.nokia.helium.core.ant.types;
    19 
    19 
       
    20 import java.util.ArrayList;
    20 import java.util.Collection;
    21 import java.util.Collection;
    21 import java.util.HashMap;
    22 import java.util.HashMap;
    22 import java.util.List;
    23 import java.util.List;
    23 
    24 
       
    25 import org.apache.tools.ant.BuildException;
       
    26 import org.apache.tools.ant.types.DataType;
       
    27 
    24 import com.nokia.helium.core.ant.MappedVariable;
    28 import com.nokia.helium.core.ant.MappedVariable;
    25 import com.nokia.helium.core.ant.Variable;
    29 import com.nokia.helium.core.ant.Variable;
    26 import com.nokia.helium.core.ant.VariableMap;
    30 import com.nokia.helium.core.ant.VariableMap;
    27 
       
    28 
       
    29 import org.apache.tools.ant.BuildException;
       
    30 import org.apache.tools.ant.types.DataType;
       
    31 import java.util.ArrayList;
       
    32 
    31 
    33 /**
    32 /**
    34  * Helper class to store the variable set (list of variables
    33  * Helper class to store the variable set (list of variables
    35  * with name / value pair)
    34  * with name / value pair)
    36  * @ant.type name="argSet" category="Core"
    35  * @ant.type name="argSet" category="Core"
   106         } else {
   105         } else {
   107             HashMap<String, MappedVariable> allVariables = new HashMap<String, MappedVariable>();
   106             HashMap<String, MappedVariable> allVariables = new HashMap<String, MappedVariable>();
   108             for (Variable variable : variables) {
   107             for (Variable variable : variables) {
   109                 if (variable instanceof MappedVariable) {
   108                 if (variable instanceof MappedVariable) {
   110                     allVariables.put(((MappedVariable)variable).getName(), (MappedVariable)variable);
   109                     allVariables.put(((MappedVariable)variable).getName(), (MappedVariable)variable);
   111                 } else if (variable instanceof VariableSet)
   110                 } else if (variable instanceof VariableSet) {
   112                     allVariables.putAll(((VariableSet)variable).getVariablesMap());
   111                     allVariables.putAll(((VariableSet)variable).getVariablesMap());
       
   112                 }
   113             }
   113             }
   114             return allVariables;
   114             return allVariables;
   115         }
   115         }
   116     }
   116     }
   117 
   117