Package org.apache.tools.ant.types
Class FilterSet
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.FilterSet
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Individual filter component of filterset.class
The filtersfile nested element.static class
EnumeratedAttribute to set behavior WRT missing filtersfiles: "fail" (default), "warn", "ignore". -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default token end stringstatic final String
The default token start stringFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfiguredFilterSet
(FilterSet filterSet) Add a Filterset to this filter set.void
addConfiguredPropertySet
(PropertySet propertySet) Adds the properties provided by the specified PropertySet to this filterset.void
Add a new filter made from the given token and value.void
addFilter
(FilterSet.Filter filter) Add a new filter.clone()
Clone the filterset.Create a new FiltersFile.Get the begin token for this filterset.Get the end token for this filterset.Gets the filter hash of the FilterSet.protected Vector
<FilterSet.Filter> Get the filters in the filter set.Get the onMissingFiltersFile setting.protected FilterSet
getRef()
Get the referenced filter set.boolean
Test to see if this filter set has filters.boolean
Get whether recursive token expansion is enabled.void
readFiltersFromFile
(File filtersFile) Read the filters from the given file.replaceTokens
(String line) Does replacement on the given string with token matching.void
setBeginToken
(String startOfToken) Set the string used to id the beginning of a token.void
setEndToken
(String endOfToken) Set the string used to id the end of a token.void
setFiltersfile
(File filtersFile) Set the file containing the filters for this filterset.void
setOnMissingFiltersFile
(FilterSet.OnMissing onMissingFiltersFile) Set the behavior WRT missing filtersfiles.void
setRecurse
(boolean recurse) Set whether recursive token expansion is enabled.Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toString
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Field Details
-
DEFAULT_TOKEN_START
-
DEFAULT_TOKEN_END
-
-
Constructor Details
-
FilterSet
public FilterSet()Default constructor. -
FilterSet
Create a Filterset from another filterset.- Parameters:
filterset
- the filterset upon which this filterset will be based.
-
-
Method Details
-
getFilters
Get the filters in the filter set.- Returns:
- a Vector of Filter instances.
-
getRef
Get the referenced filter set.- Returns:
- the filterset from the reference.
-
getFilterHash
-
setFiltersfile
Set the file containing the filters for this filterset.- Parameters:
filtersFile
- sets the filter file from which to read filters for this filter set.- Throws:
BuildException
- if there is an error.
-
setBeginToken
Set the string used to id the beginning of a token.- Parameters:
startOfToken
- The new Begintoken value.
-
getBeginToken
Get the begin token for this filterset.- Returns:
- the filter set's begin token for filtering.
-
setEndToken
Set the string used to id the end of a token.- Parameters:
endOfToken
- The new Endtoken value.
-
getEndToken
Get the end token for this filterset.- Returns:
- the filter set's end token for replacement delimiting.
-
setRecurse
public void setRecurse(boolean recurse) Set whether recursive token expansion is enabled.- Parameters:
recurse
-boolean
whether to recurse.
-
isRecurse
public boolean isRecurse()Get whether recursive token expansion is enabled.- Returns:
boolean
whether enabled.
-
readFiltersFromFile
Read the filters from the given file.- Parameters:
filtersFile
- the file from which filters are read.- Throws:
BuildException
- when the file cannot be read.
-
replaceTokens
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.- Parameters:
line
- The line in which to process embedded tokens.- Returns:
- The input string after token replacement.
-
addFilter
Add a new filter.- Parameters:
filter
- the filter to be added.
-
createFiltersfile
Create a new FiltersFile.- Returns:
- The filtersfile that was created.
-
addFilter
-
addConfiguredFilterSet
Add a Filterset to this filter set.- Parameters:
filterSet
- the filterset to be added to this filterset
-
addConfiguredPropertySet
Adds the properties provided by the specified PropertySet to this filterset.- Parameters:
propertySet
- the propertyset to be added to this propertyset
-
hasFilters
public boolean hasFilters()Test to see if this filter set has filters.- Returns:
- Return true if there are filters in this set.
-
clone
Clone the filterset.- Overrides:
clone
in classDataType
- Returns:
- a deep clone of this filterset.
- Throws:
BuildException
- if the clone cannot be performed.
-
setOnMissingFiltersFile
Set the behavior WRT missing filtersfiles.- Parameters:
onMissingFiltersFile
- the OnMissing describing the behavior.
-
getOnMissingFiltersFile
Get the onMissingFiltersFile setting.- Returns:
- the OnMissing instance.
-