Class ScriptMapper
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.optional.AbstractScriptComponent
org.apache.tools.ant.types.optional.ScriptMapper
- All Implemented Interfaces:
Cloneable, FileNameMapper
Script support at map time.
- Since:
- Ant1.7
-
Field Summary
Fields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMappedName(String mapping) Add a mapped namevoidclear()Reset the list of filesString[]mapFileName(String sourceFileName) Returns an array containing the target filename(s) for the given source file.voidSets the from part of the transformation rule.voidSets the to part of the transformation rule.Methods inherited from class AbstractScriptComponent
addText, createClasspath, executeScript, getRunner, initScriptRunner, setClasspath, setClasspathRef, setEncoding, setLanguage, setManager, setManager, setProject, setSetBeans, setSrcModifier and TypeMethodDescriptionvoidThe script text.Classpath to be used when searching for classes and resources.protected voidexecuteScript(String execName) Run a scriptGet our script runnerprotected voidInitialize the script runner.voidsetClasspath(Path classpath) Set the classpath to be used when searching for classes and resources.voidSet the classpath by reference.voidsetEncoding(String encoding) Set the encoding of the script from an external file; optional.voidsetLanguage(String language) Defines the language (required).voidsetManager(String manager) Deprecated.voidsetManager(ScriptManager manager) Set the script manager.voidsetProject(Project project) Set the project.voidsetSetBeans(boolean setBeans) Set the setbeans attribute.voidLoad the script from an external file; optional.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocationModifier and TypeMethodDescriptionclone()Returns 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.
-
Constructor Details
-
ScriptMapper
public ScriptMapper()
-
-
Method Details
-
setFrom
Sets the from part of the transformation rule.- Specified by:
setFromin interfaceFileNameMapper- Parameters:
from- a string.
-
setTo
Sets the to part of the transformation rule.- Specified by:
setToin interfaceFileNameMapper- Parameters:
to- a string.
-
clear
public void clear()Reset the list of files -
addMappedName
-
mapFileName
Returns an array containing the target filename(s) for the given source file.if the given rule doesn't apply to the source file, implementation must return null. SourceFileScanner will then omit the source file in question.
- Specified by:
mapFileNamein interfaceFileNameMapper- Parameters:
sourceFileName- the name of the source file relative to some given basedirectory.- Returns:
- an array of strings if the rule applies to the source file, or null if it does not.
-