org.apache.tools.ant.types
Class FilterSet
- Cloneable
public class FilterSet
implements Cloneable
A set of filters to be applied to something.
A filter set may have begintoken and endtokens defined.
checkAttributesAllowed , checkChildrenAllowed , circularReference , dieOnCircularReference , getCheckedRef , getDescription , getRefid , isChecked , isReference , noChildrenAllowed , setChecked , setDescription , setRefid , tooManyAttributes |
DEFAULT_TOKEN_END
public static final String DEFAULT_TOKEN_END
The default token end string
DEFAULT_TOKEN_START
public static final String DEFAULT_TOKEN_START
The default token start string
FilterSet
public FilterSet()
Default constructor
FilterSet
protected FilterSet(FilterSet filterset)
Create a Filterset from another filterset
filterset
- the filterset upon which this filterset will be based.
addConfiguredFilterSet
public void addConfiguredFilterSet(FilterSet filterSet)
Add a Filterset to this filter set
filterSet
- the filterset to be added to this filterset
addFilter
public void addFilter(String token,
String value)
Add a new filter made from the given token and value.
token
- The token for the new filter.value
- The value for the new filter.
addFilter
public void addFilter(FilterSet.Filter filter)
Create a new filter
filter
- the filter to be added
clone
public Object clone()
throws BuildException
clone the filterset
- a deep clone of this filterset
BuildException
- if the clone cannot be performed.
createFiltersfile
public FilterSet.FiltersFile createFiltersfile()
Create a new FiltersFile
- The filter that was created.
getBeginToken
public String getBeginToken()
Get the begin token for this filterset
- the filter set's begin token for filtering
getEndToken
public String getEndToken()
Get the end token for this filterset
- the filter set's end token for replacement delimiting
getFilterHash
public Hashtable getFilterHash()
Gets the filter hash of the FilterSet.
- The hash of the tokens and values for quick lookup.
getFilters
protected Vector getFilters()
Get the filters in the filter set
- a Vector of Filter instances
getRef
protected FilterSet getRef()
Get the referred filter set
- the filterset from the reference.
hasFilters
public boolean hasFilters()
Test to see if this filter set it empty.
- Return true if there are filter in this set otherwise false.
readFiltersFromFile
public void readFiltersFromFile(File filtersFile)
throws BuildException
Read the filters from the given file.
filtersFile
- the file from which filters are read
BuildException
- Throw a build exception when unable to read the
file.
replaceTokens
public String replaceTokens(String line)
Does replacement on the given string with token matching.
This uses the defined begintoken and endtoken values which default
to @ for both.
This resets the passedTokens and calls iReplaceTokens to
do the actual replacements.
line
- The line to process the tokens in.
- The string with the tokens replaced.
setBeginToken
public void setBeginToken(String startOfToken)
The string used to id the beginning of a token.
startOfToken
- The new Begintoken value
setEndToken
public void setEndToken(String endOfToken)
The string used to id the end of a token.
endOfToken
- The new Endtoken value
setFiltersfile
public void setFiltersfile(File filtersFile)
throws BuildException
set the file containing the filters for this filterset.
filtersFile
- sets the filter fil to read filters for this filter set from.
BuildException
- if there is a problem reading the filters
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.