FileDocCategorySizeDatePackage
OrSelector.javaAPI DocApache Ant 1.702450Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.types.selectors

OrSelector

public class OrSelector extends BaseSelectorContainer
This selector has a collection of other selectors, any of which have to select a file in order for this selector to select it.
since
1.5

Fields Summary
Constructors Summary
public OrSelector()
Default constructor.

    
Methods Summary
public booleanisSelected(java.io.File basedir, java.lang.String filename, java.io.File file)
Returns true (the file is selected) if any of the other selectors agree that the file should be selected.

param
basedir the base directory the scan is being done from
param
filename the name of the file to check
param
file a java.io.File object for the filename that the selector can use
return
whether the file should be selected or not

        validate();
        Enumeration e = selectorElements();
        boolean result;

        // First, check that all elements are correctly configured
        while (e.hasMoreElements()) {
            result = ((FileSelector) e.nextElement()).isSelected(basedir,
                    filename, file);
            if (result) {
                return true;
            }
        }
        return false;
    
public java.lang.StringtoString()

return
a string representation of the selector

        StringBuffer buf = new StringBuffer();
        if (hasSelectors()) {
            buf.append("{orselect: ");
            buf.append(super.toString());
            buf.append("}");
        }
        return buf.toString();