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
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class FilterSet extends DataType implements java.lang.Cloneable A set of filters to be applied to something. A filter set may have begintoken and endtokens defined.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFilterSet.FilterIndividual filter component of filterset.classFilterSet.FiltersFileThe filtersfile nested element.static classFilterSet.OnMissingEnumeratedAttribute to set behavior WRT missing filtersfiles: "fail" (default), "warn", "ignore".
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDEFAULT_TOKEN_ENDThe default token end stringstatic java.lang.StringDEFAULT_TOKEN_STARTThe default token start string- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Method SummaryModifier and Type Method Description voidaddConfiguredFilterSet(FilterSet filterSet)Add a Filterset to this filter set.voidaddConfiguredPropertySet(PropertySet propertySet)Adds the properties provided by the specified PropertySet to this filterset.voidaddFilter(java.lang.String token, java.lang.String value)Add a new filter made from the given token and value.voidaddFilter(FilterSet.Filter filter)Add a new filter.java.lang.Objectclone()Clone the filterset.FilterSet.FiltersFilecreateFiltersfile()Create a new FiltersFile.java.lang.StringgetBeginToken()Get the begin token for this filterset.java.lang.StringgetEndToken()Get the end token for this filterset.java.util.Hashtable<java.lang.String,java.lang.String>getFilterHash()Gets the filter hash of the FilterSet.protected java.util.Vector<FilterSet.Filter>getFilters()Get the filters in the filter set.FilterSet.OnMissinggetOnMissingFiltersFile()Get the onMissingFiltersFile setting.protected FilterSetgetRef()Get the referenced filter set.booleanhasFilters()Test to see if this filter set has filters.booleanisRecurse()Get whether recursive token expansion is enabled.voidreadFiltersFromFile(java.io.File filtersFile)Read the filters from the given file.java.lang.StringreplaceTokens(java.lang.String line)Does replacement on the given string with token matching.voidsetBeginToken(java.lang.String startOfToken)Set the string used to id the beginning of a token.voidsetEndToken(java.lang.String endOfToken)Set the string used to id the end of a token.voidsetFiltersfile(java.io.File filtersFile)Set the file containing the filters for this filterset.voidsetOnMissingFiltersFile(FilterSet.OnMissing onMissingFiltersFile)Set the behavior WRT missing filtersfiles.voidsetRecurse(boolean recurse)Set whether recursive token expansion is enabled.- 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, 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.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_TOKEN_STARTpublic static final java.lang.String DEFAULT_TOKEN_START The default token start string- See Also:
- Constant Field Values
 
 - 
DEFAULT_TOKEN_ENDpublic static final java.lang.String DEFAULT_TOKEN_END The default token end string- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
FilterSetpublic FilterSet() Default constructor.
 - 
FilterSetprotected FilterSet(FilterSet filterset) Create a Filterset from another filterset.- Parameters:
- filterset- the filterset upon which this filterset will be based.
 
 
- 
 - 
Method Detail- 
getFiltersprotected java.util.Vector<FilterSet.Filter> getFilters() Get the filters in the filter set.- Returns:
- a Vector of Filter instances.
 
 - 
getRefprotected FilterSet getRef() Get the referenced filter set.- Returns:
- the filterset from the reference.
 
 - 
getFilterHashpublic java.util.Hashtable<java.lang.String,java.lang.String> getFilterHash() Gets the filter hash of the FilterSet.- Returns:
- The hash of the tokens and values for quick lookup.
 
 - 
setFiltersfilepublic void setFiltersfile(java.io.File filtersFile) throws BuildExceptionSet 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.
 
 - 
setBeginTokenpublic void setBeginToken(java.lang.String startOfToken) Set the string used to id the beginning of a token.- Parameters:
- startOfToken- The new Begintoken value.
 
 - 
getBeginTokenpublic java.lang.String getBeginToken() Get the begin token for this filterset.- Returns:
- the filter set's begin token for filtering.
 
 - 
setEndTokenpublic void setEndToken(java.lang.String endOfToken) Set the string used to id the end of a token.- Parameters:
- endOfToken- The new Endtoken value.
 
 - 
getEndTokenpublic java.lang.String getEndToken() Get the end token for this filterset.- Returns:
- the filter set's end token for replacement delimiting.
 
 - 
setRecursepublic void setRecurse(boolean recurse) Set whether recursive token expansion is enabled.- Parameters:
- recurse-- booleanwhether to recurse.
 
 - 
isRecursepublic boolean isRecurse() Get whether recursive token expansion is enabled.- Returns:
- booleanwhether enabled.
 
 - 
readFiltersFromFilepublic void readFiltersFromFile(java.io.File filtersFile) throws BuildExceptionRead the filters from the given file.- Parameters:
- filtersFile- the file from which filters are read.
- Throws:
- BuildException- when the file cannot be read.
 
 - 
replaceTokenspublic java.lang.String replaceTokens(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. 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.
 
 - 
addFilterpublic void addFilter(FilterSet.Filter filter) Add a new filter.- Parameters:
- filter- the filter to be added.
 
 - 
createFiltersfilepublic FilterSet.FiltersFile createFiltersfile() Create a new FiltersFile.- Returns:
- The filtersfile that was created.
 
 - 
addFilterpublic void addFilter(java.lang.String token, java.lang.String value)Add a new filter made from the given token and value.- Parameters:
- token- The token for the new filter.
- value- The value for the new filter.
 
 - 
addConfiguredFilterSetpublic void addConfiguredFilterSet(FilterSet filterSet) Add a Filterset to this filter set.- Parameters:
- filterSet- the filterset to be added to this filterset
 
 - 
addConfiguredPropertySetpublic void addConfiguredPropertySet(PropertySet propertySet) Adds the properties provided by the specified PropertySet to this filterset.- Parameters:
- propertySet- the propertyset to be added to this propertyset
 
 - 
hasFilterspublic boolean hasFilters() Test to see if this filter set has filters.- Returns:
- Return true if there are filters in this set.
 
 - 
clonepublic java.lang.Object clone() throws BuildExceptionClone the filterset.- Overrides:
- clonein class- DataType
- Returns:
- a deep clone of this filterset.
- Throws:
- BuildException- if the clone cannot be performed.
 
 - 
setOnMissingFiltersFilepublic void setOnMissingFiltersFile(FilterSet.OnMissing onMissingFiltersFile) Set the behavior WRT missing filtersfiles.- Parameters:
- onMissingFiltersFile- the OnMissing describing the behavior.
 
 - 
getOnMissingFiltersFilepublic FilterSet.OnMissing getOnMissingFiltersFile() Get the onMissingFiltersFile setting.- Returns:
- the OnMissing instance.
 
 
- 
 
-