字段摘要 | |
---|---|
String |
classname
specifies the implementation by class name. |
String |
classpath
the classpath to use when looking up classname . |
String |
classpathref
the classpath to use, given as reference to a path defined elsewhere. |
String |
from
the from attribute for the given implementation. |
String |
id
|
String |
idref
|
String |
to
the to attribute for the given implementation. |
String |
type
|
方法摘要 | |
---|---|
|
toString
|
子事物摘要 | |
---|---|
|
chainedmapper
This mapper implementation can contain multiple nested mappers. File mapping is performed by passing the source filename to the first nested mapper, its results to the second, and so on. The target filenames generated by the last nested mapper comprise the ultimate results of the mapping operation. The to and from attributes are ignored. |
|
compositemapper
This mapper implementation can contain multiple nested mappers. File mapping is performed by passing the source filename to each nested |
|
cutdirsmapper
This mapper strips a configured number of leading directories from the source file name. |
|
filtermapper
This mapper implementation applies a filterchain to the source file name. |
|
firstmatchmapper
This mapper supports an arbitrary number of nested mappers and returns the results of the first mapper that matches. This is different from composite mapper which collects the results of all matching children. |
|
flattenmapper
The target file name is identical to the source file name, with all leading directory information stripped off. Both to and from will be ignored. |
|
globmapper
Both to and from are required and define patterns that may contain at most one * . For each source file that matches the from pattern, a target file name will be constructed from the to pattern by substituting the * in the to pattern with the text that matches the * in the from pattern. Source file names that don't match the from pattern will be ignored. |
|
identitymapper
The target file name is identical to the source file name. Both to and from will be ignored. |
|
mergemapper
The target file name will always be the same, as defined by to - from will be ignored. |
|
packagemapper
Sharing the same syntax as the glob mapper, the package mapper replaces directory separators found in the matched source pattern with dots in the target pattern placeholder. This mapper is particularly useful in combination with |
|
regexpmapper
Both |
|
scriptmapper
This mapper executes a script written in Apache BSF or JSR 223 supported language, once per file to map. |
|
unpackagemapper
This mapper is the inverse of the package mapper. It replaces the dots in a package name with directory separators. This is useful for matching XML formatter results against their JUnit test test cases. The mapper shares the sample syntax as the glob mapper. |
字段详细信息 |
---|
specifies the implementation by class name.
the classpath to use when looking up classname
.
the classpath to use, given as reference to a path defined elsewhere.
the from
attribute for the given implementation.
the to
attribute for the given implementation.
方法详细信息 |
---|
子事物详细信息 |
---|
This mapper implementation can contain multiple nested mappers. File mapping is performed by passing the source filename to the first nested mapper, its results to the second, and so on. The target filenames generated by the last nested mapper comprise the ultimate results of the mapping operation. The to and from attributes are ignored.
This mapper implementation can contain multiple nested mappers. File mapping is performed by passing the source filename to each nested <mapper>
in turn, returning all results. The to and from attributes are ignored.
Starting with Ant 1.8.0 the order of the mapped results is the same as the order of the nested mappers; prior to Ant 1.8.0 the order has been undefined.
This mapper strips a configured number of leading directories from the source file name.
This mapper implementation applies a filterchain to the source file name.
This mapper supports an arbitrary number of nested mappers and returns the results of the first mapper that matches. This is different from composite mapper which collects the results of all matching children.
The target file name is identical to the source file name, with all leading directory information stripped off. Both to
and from
will be ignored.
Both to
and from
are required and define patterns that may contain at most one *
. For each source file that matches the from
pattern, a target file name will be constructed from the to
pattern by substituting the *
in the to
pattern with the text that matches the *
in the from
pattern. Source file names that don't match the from
pattern will be ignored.
The target file name is identical to the source file name. Both to
and from
will be ignored.
The target file name will always be the same, as defined by to
- from
will be ignored.
Sharing the same syntax as the glob mapper, the package mapper replaces directory separators found in the matched source pattern with dots in the target pattern placeholder. This mapper is particularly useful in combination with <uptodate>
and <junit>
output.
The to and from attributes are both required.
Both to
and from
are required and define regular expressions. If the source file name (as a whole or in part) matches the from
pattern, the target file name will be constructed from the to
pattern, using \0
to \9
as back-references for the full match (\0
) or the matches of the subexpressions in parentheses. The to
pattern determines the whole file name, so if you wanted to replace the extension of a file you should not use from="\.old$" to=".new"
but rather from="(.*)\.old$" to="\1.new"
(or rather use a glob mapper in this case).
Source files not matching the from
pattern will be ignored.
Note that you need to escape a dollar-sign ($
) with another dollar-sign in Ant.
The regexp mapper needs a supporting library and an implementation of org.apache.tools.ant.util.regexp.RegexpMatcher
that hides the specifics of the library. Since Ant 1.8.0 Ant requires Java 1.4 to run, so the implementation based on the java.util.regex
package will always be available. You can still use the now retired Jakarta ORO or Jakarta Regex instead if your provide the corresponding jar in your CLASSPATH.
For information about using gnu.regexp or gnu.rex with Ant, see this article.
If you want to use one of the regular expression libraries other than java.util.regex
you need to also use the corresponding ant-[apache-oro, apache-regexp].jar
from the Ant release you are using. Make sure, both will be loaded from the same classpath, that is either put them into your CLASSPATH
, ANT_HOME/lib
directory or a nested <classpath>
element of the mapper - you cannot have ant-[apache-oro, apache-regexp].jar
in ANT_HOME/lib
and the library in a nested <classpath>
.
Ant will choose the regular-expression library based on the following algorithm:
ant.regexp.matcherimpl
has been set, it is taken as the name of the class implementingorg.apache.tools.ant.util.regexp.RegexpMatcher
that should be used.This mapper executes a script written in Apache BSF or JSR 223 supported language, once per file to map.
The script can be declared inline or in a specified file.
See the Script task for an explanation of scripts and dependencies.
This mapper is the inverse of the package mapper. It replaces the dots in a package name with directory separators. This is useful for matching XML formatter results against their JUnit test test cases. The mapper shares the sample syntax as the glob mapper.
The to and from attributes are both required.