Class FilterChain
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.FilterChain
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
FilterMapper
FilterChain may contain a chained set of filter readers.
-
Field Summary
Fields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ChainableReader filter) Add a chainfilter filter.voidaddClassConstants(ClassConstants classConstants) Add a ClassConstants filter.voidAdd a containsregex filter.voidAdd a delete characters filter.voidaddEscapeUnicode(EscapeUnicode escapeUnicode) Add an EscapeUnicode filter.voidaddExpandProperties(ExpandProperties expandProperties) Add an ExpandProperties filter.voidaddFilterReader(AntFilterReader filterReader) Add an AntFilterReader filter.voidaddHeadFilter(HeadFilter headFilter) Add a HeadFilter filter.voidAdd an ignoreBlank filter.voidaddLineContains(LineContains lineContains) Add a LineContains filter.voidaddLineContainsRegExp(LineContainsRegExp lineContainsRegExp) Add a LineContainsRegExp filter.voidaddPrefixLines(PrefixLines prefixLines) Add a PrefixLines filter.voidAdd a replaceregex filter.voidAdd a replacestring filter.voidaddReplaceTokens(ReplaceTokens replaceTokens) Add a ReplaceTokens filter.voidaddStripJavaComments(StripJavaComments stripJavaComments) Add a StripJavaCommands filter.voidaddStripLineBreaks(StripLineBreaks stripLineBreaks) Add a StripLineBreaks filter.voidaddStripLineComments(StripLineComments stripLineComments) Add a StripLineComments filter.voidaddSuffixLines(SuffixLines suffixLines) Add a SuffixLines filter.voidaddTabsToSpaces(TabsToSpaces tabsToSpaces) Add a TabsToSpaces filter.voidaddTailFilter(TailFilter tailFilter) Add a TailFilter filter.voidaddTokenFilter(TokenFilter tokenFilter) Add a TokenFilter filter.voidaddTrim(TokenFilter.Trim filter) Add a trim filter.protected voiddieOnCircularReference(Stack<Object> stk, Project p) 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).Return the filters.voidMakes this instance in effect a reference to another FilterChain instance.Methods inherited from class DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, 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.clone()protected voidConvenience method.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.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.
-
Constructor Details
-
FilterChain
public FilterChain()
-
-
Method Details
-
addFilterReader
Add an AntFilterReader filter.- Parameters:
filterReader- anAntFilterReadervalue
-
getFilterReaders
-
addClassConstants
Add a ClassConstants filter.- Parameters:
classConstants- aClassConstantsvalue
-
addExpandProperties
Add an ExpandProperties filter.- Parameters:
expandProperties- anExpandPropertiesvalue
-
addHeadFilter
Add a HeadFilter filter.- Parameters:
headFilter- aHeadFiltervalue
-
addLineContains
Add a LineContains filter.- Parameters:
lineContains- aLineContainsvalue
-
addLineContainsRegExp
Add a LineContainsRegExp filter.- Parameters:
lineContainsRegExp- aLineContainsRegExpvalue
-
addPrefixLines
Add a PrefixLines filter.- Parameters:
prefixLines- aPrefixLinesvalue
-
addSuffixLines
Add a SuffixLines filter.- Parameters:
suffixLines- aSuffixLinesvalue- Since:
- Ant 1.8.0
-
addReplaceTokens
Add a ReplaceTokens filter.- Parameters:
replaceTokens- aReplaceTokensvalue
-
addStripJavaComments
Add a StripJavaCommands filter.- Parameters:
stripJavaComments- aStripJavaCommentsvalue
-
addStripLineBreaks
Add a StripLineBreaks filter.- Parameters:
stripLineBreaks- aStripLineBreaksvalue
-
addStripLineComments
Add a StripLineComments filter.- Parameters:
stripLineComments- aStripLineCommentsvalue
-
addTabsToSpaces
Add a TabsToSpaces filter.- Parameters:
tabsToSpaces- aTabsToSpacesvalue
-
addTailFilter
Add a TailFilter filter.- Parameters:
tailFilter- aTailFiltervalue
-
addEscapeUnicode
Add an EscapeUnicode filter.- Parameters:
escapeUnicode- anEscapeUnicodevalue- Since:
- Ant 1.6
-
addTokenFilter
Add a TokenFilter filter.- Parameters:
tokenFilter- aTokenFiltervalue- Since:
- Ant 1.6
-
addDeleteCharacters
Add a delete characters filter.- Parameters:
filter- aTokenFilter.DeleteCharactersvalue- Since:
- Ant 1.6
-
addContainsRegex
Add a containsregex filter.- Parameters:
filter- aTokenFilter.ContainsRegexvalue- Since:
- Ant 1.6
-
addReplaceRegex
Add a replaceregex filter.- Parameters:
filter- aTokenFilter.ReplaceRegexvalue
-
addTrim
Add a trim filter.- Parameters:
filter- aTokenFilter.Trimvalue- Since:
- Ant 1.6
-
addReplaceString
Add a replacestring filter.- Parameters:
filter- aTokenFilter.ReplaceStringvalue- Since:
- Ant 1.6
-
addIgnoreBlank
Add an ignoreBlank filter.- Parameters:
filter- aTokenFilter.IgnoreBlankvalue- Since:
- Ant 1.6
-
setRefid
Makes this instance in effect a reference to another FilterChain instance.You must not set another attribute or nest elements inside this element if you make it a reference.
- Overrides:
setRefidin classDataType- Parameters:
r- the reference to which this instance is associated- Throws:
BuildException- if this instance already has been configured.
-
add
Add a chainfilter filter.- Parameters:
filter- aChainableReadervalue- Since:
- Ant 1.6
-
dieOnCircularReference
Description copied from class:DataTypeCheck 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).If one is included, throw a BuildException created by
circularReference.This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do anything if
DataType.checkedis true and set it to true on exit.- Overrides:
dieOnCircularReferencein classDataType- Parameters:
stk- the stack of references to check.p- the project to use to dereference the references.- Throws:
BuildException- on error.
-