FileDocCategorySizeDatePackage
FilterSetCollection.javaAPI DocApache Ant 1.702802Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.types

FilterSetCollection

public class FilterSetCollection extends Object
A FilterSetCollection is a collection of filtersets each of which may have a different start/end token settings.

Fields Summary
private Vector
filterSets
Constructors Summary
public FilterSetCollection()
Constructor for a FilterSetCollection.


             
      
    
public FilterSetCollection(FilterSet filterSet)
Constructor for a FilterSetCollection.

param
filterSet a filterset to start the collection with

        addFilterSet(filterSet);
    
Methods Summary
public voidaddFilterSet(FilterSet filterSet)
Add a filterset to the collection.

param
filterSet a FilterSet value

        filterSets.addElement(filterSet);
    
public booleanhasFilters()
Test to see if this filter set it empty.

return
Return true if there are filter in this set otherwise false.

        for (Enumeration e = filterSets.elements(); e.hasMoreElements();) {
            FilterSet filterSet = (FilterSet) e.nextElement();
            if (filterSet.hasFilters()) {
                return true;
            }
        }
        return false;
    
public java.lang.StringreplaceTokens(java.lang.String line)
Does replacement on the given string with token matching. This uses the defined begintoken and endtoken values which default to @ for both.

param
line The line to process the tokens in.
return
The string with the tokens replaced.

        String replacedLine = line;
        for (Enumeration e = filterSets.elements(); e.hasMoreElements();) {
            FilterSet filterSet = (FilterSet) e.nextElement();
            replacedLine = filterSet.replaceTokens(replacedLine);
        }
        return replacedLine;