コード例 #1
0
 @Override
 public IEnvironmentVariable getVariable(String name, Object context) {
   if (getValidName(name) == null) return null;
   IEnvironmentVariable var = fOverrideVariables.getVariable(name);
   StorableEnvironment env = getEnvironment(context);
   if (env == null) return var;
   return EnvVarOperationProcessor.performOperation(env.getVariable(name), var);
 }
コード例 #2
0
 private IEnvironmentVariable[] combineVariables(
     IEnvironmentVariable[] oldVariables, IEnvironmentVariable[] newVariables) {
   Map<String, IEnvironmentVariable> vars =
       new HashMap<String, IEnvironmentVariable>(oldVariables.length + newVariables.length);
   for (IEnvironmentVariable variable : oldVariables) vars.put(variable.getName(), variable);
   for (IEnvironmentVariable variable : newVariables) {
     if (!vars.containsKey(variable.getName())) vars.put(variable.getName(), variable);
     else
       vars.put(
           variable.getName(),
           EnvVarOperationProcessor.performOperation(vars.get(variable.getName()), variable));
   }
   return vars.values().toArray(new IEnvironmentVariable[vars.size()]);
 }
コード例 #3
0
 protected IEnvironmentVariable[] filterVariables(IEnvironmentVariable variables[]) {
   return EnvVarOperationProcessor.filterVariables(variables, null);
 }