FileDocCategorySizeDatePackage
ParamSet.javaAPI DocApache Axis 1.44307Sat Apr 22 18:57:28 BST 2006org.apache.axis.tools.ant.foreach

ParamSet

public class ParamSet extends Object
Inner class stores sets of s. It can hold s or s or both.
author
Tim Vernum
author
Davanum Srinivas
author
Richard A. Sitze

Fields Summary
public static final String
TYPE_FILE
public static final String
TYPE_DIR
public static final String
TYPE_BOTH
protected String
type
Defaults to "file".
private Vector
filesets
private Vector
items
private String
name
Constructors Summary
public ParamSet()


      
        filesets = new Vector();
        items = new Vector();
    
Methods Summary
public voidaddFileset(org.apache.tools.ant.types.FileSet fileset)

        filesets.addElement(fileset);
    
public ParamItemcreateItem()

        ParamItem item = new ParamItem();
        items.addElement(item);
        return item;
    
protected java.lang.String[]getDirs(java.io.File basedir, org.apache.tools.ant.DirectoryScanner ds)
Return the list of Directories from this DirectoryScanner that should be included on the command line.

        return ds.getIncludedDirectories();
    
protected java.lang.String[]getFiles(java.io.File basedir, org.apache.tools.ant.DirectoryScanner ds)
Return the list of files from this DirectoryScanner that should be included on the command line.

        return ds.getIncludedFiles();
    
public java.lang.StringgetName()

        return name;
    
public java.util.EnumerationgetValues(org.apache.tools.ant.Project project)

        /* As an arbitrary rule, this will return filesets first,
        and then <item>s. The ordering of the buildfile is
        not guaranteed. */
        Vector values = new Vector();
        Enumeration enum = filesets.elements();
        while (enum.hasMoreElements()) {
            FileSet fileSet = (FileSet) enum.nextElement();
            File base = fileSet.getDir(project);
            DirectoryScanner scanner = fileSet.getDirectoryScanner(project);
            if (TYPE_DIR != type) {
                String[] files = getFiles(base, scanner);
                for (int j = 0; j < files.length; j++) {
                    File f = new File(base, files[j]);
                    values.addElement(f.getAbsolutePath());
                }
            }
            if (TYPE_FILE != type) {
                String[] dirs = getDirs(base, scanner);
                for (int j = 0; j < dirs.length; j++) {
                    File f = new File(base, dirs[j]);
                    values.addElement(f.getAbsolutePath());
                }
            }
        }
        enum = items.elements();
        while (enum.hasMoreElements()) {
            ParamItem item = (ParamItem) enum.nextElement();
            values.addElement(item.getValue());
        }
        return values.elements();
    
public voidsetName(java.lang.String name)

        this.name = name;
    
public voidsetType(org.apache.axis.tools.ant.foreach.ParamSet$FileDirBoth type)
Shall the command work only on files, directories or both?

        this.type = type.getValue().intern();