FileDocCategorySizeDatePackage
Environment.javaAPI DocApache Ant 1.704877Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.types

Environment

public class Environment extends Object
Wrapper for environment variables.

Fields Summary
protected Vector
variables
a vector of type Enviromment.Variable
Constructors Summary
public Environment()
constructor

        variables = new Vector();
    
Methods Summary
public voidaddVariable(org.apache.tools.ant.types.Environment$Variable var)
add a variable. Validity checking is not performed at this point. Duplicates are not caught either.

param
var new variable.

        variables.addElement(var);
    
public java.lang.String[]getVariables()
get the variable list as an array

return
array of key=value assignment strings
throws
BuildException if any variable is misconfigured

        if (variables.size() == 0) {
            return null;
        }
        String[] result = new String[variables.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = ((Variable) variables.elementAt(i)).getContent();
        }
        return result;
    
public java.util.VectorgetVariablesVector()
Get the raw vector of variables. This is not a clone.

return
a potentially empty (but never null) vector of elements of type Variable
since
Ant 1.7

        return variables;