Class FilterMapper
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.FilterChain
org.apache.tools.ant.types.mappers.FilterMapper
- All Implemented Interfaces:
Cloneable, FileNameMapper
This is a FileNameMapper based on a FilterChain.
-
Field Summary
Fields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class FilterChain
add, addClassConstants, addContainsRegex, addDeleteCharacters, addEscapeUnicode, addExpandProperties, addFilterReader, addHeadFilter, addIgnoreBlank, addLineContains, addLineContainsRegExp, addPrefixLines, addReplaceRegex, addReplaceString, addReplaceTokens, addStripJavaComments, addStripLineBreaks, addStripLineComments, addSuffixLines, addTabsToSpaces, addTailFilter, addTokenFilter, addTrim, dieOnCircularReference, getFilterReaders, setRefidModifier 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
-
FilterMapper
public FilterMapper()
-
-
Method Details
-
setFrom
From attribute not supported.- Specified by:
setFromin interfaceFileNameMapper- Parameters:
from- a string- Throws:
BuildException- always
-
setTo
From attribute not supported.- Specified by:
setToin interfaceFileNameMapper- Parameters:
to- a string- Throws:
BuildException- always
-
mapFileName
Return the result of the filters on the sourcefilename.- Specified by:
mapFileNamein interfaceFileNameMapper- Parameters:
sourceFileName- the filename to map- Returns:
- a one-element array of converted filenames, or null if the filterchain returns an empty string.
-