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:
Cloneable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIndividual filter component of filterset.classThe filtersfile nested element.static classEnumeratedAttribute to set behavior WRT missing filtersfiles: "fail" (default), "warn", "ignore". -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default token end stringstatic final StringThe default token start stringFields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguredFilterSet(FilterSet filterSet) Add a Filterset to this filter set.voidaddConfiguredPropertySet(PropertySet propertySet) Adds the properties provided by the specified PropertySet to this filterset.voidAdd a new filter made from the given token and value.voidaddFilter(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 FilterSetgetRef()Get the referenced filter set.booleanTest to see if this filter set has filters.booleanGet whether recursive token expansion is enabled.voidreadFiltersFromFile(File filtersFile) Read the filters from the given file.replaceTokens(String line) Does replacement on the given string with token matching.voidsetBeginToken(String startOfToken) Set the string used to id the beginning of a token.voidsetEndToken(String endOfToken) Set the string used to id the end of a token.voidsetFiltersfile(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 DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toStringModifier and TypeMethodDescriptionprotected voidcheck that it is ok to set attributes, i.e that no reference is definedprotected voidcheck that it is ok to add children, i.e that no reference is definedprotected BuildExceptionCreates an exception that indicates the user has generated a loop of data types referencing each other.protected voidConvenience method.protected voiddieOnCircularReference(Stack<Object> stack, Project project) Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).protected voidConvenience method.protected <T> TDeprecated.use getCheckedRef(Class)protected <T> TgetCheckedRef(Class<T> requiredClass) Performs the check for circular references and returns the referenced object.protected <T> TgetCheckedRef(Class<T> requiredClass, String dataTypeName) Performs the check for circular references and returns the referenced object.protected <T> TgetCheckedRef(Class<T> requiredClass, String dataTypeName, Project project) Performs the check for circular references and returns the referenced object.protected <T> TDeprecated.use getCheckedRef(Class)protected StringGets as descriptive as possible a name used for this datatype instance.getRefid()get the reference set on this objectstatic voidinvokeCircularReferenceCheck(DataType dt, Stack<Object> stk, Project p) Allow DataTypes outside org.apache.tools.ant.types to indirectly call dieOnCircularReference on nested DataTypes.protected booleanThe flag that is used to indicate that circular references have been checked.booleanHas the refid attribute of this element been set?protected BuildExceptionCreates an exception that indicates that this XML element must not have child elements if the refid attribute is set.static voidpushAndInvokeCircularReferenceCheck(DataType dt, Stack<Object> stk, Project p) Allow DataTypes outside org.apache.tools.ant.types to indirectly call dieOnCircularReference on nested DataTypes.protected voidsetChecked(boolean checked) Set the flag that is used to indicate that circular references have been checked.voidSet the value of the refid attribute.protected BuildExceptionCreates an exception that indicates that refid has to be the only attribute if it is set.toString()Basic DataType toString().Methods inherited from class ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionReturns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
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-booleanwhether to recurse.
-
isRecurse
public boolean isRecurse()Get whether recursive token expansion is enabled.- Returns:
booleanwhether 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:
clonein 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.
-