Class KeySubst
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.KeySubst
- All Implemented Interfaces:
Cloneable
Deprecated.
KeySubst is deprecated since Ant 1.1. Use Filter + Copy
instead.
Keyword substitution. Input file is written to output file.
Do not make input file same as output file.
Keywords in input files look like this: @foo@. See the docs for the
setKeys method to understand how to do the substitutions.
- Since:
- Ant 1.1
-
Field Summary
Fields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Deprecated.Do the execution.static voidDeprecated.A test method.static StringDeprecated.Does replacement on text using the hashtable of keys.voidDeprecated.Set the destination file.voidDeprecated.Sets the keys.voidDeprecated.Sets the separator between name=value arguments in setKeys().voidDeprecated.Set the source file.Methods inherited from class Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeModifier and TypeMethodDescriptionfinal voidbindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another.Returns the container target of this task.Returns the wrapper used for runtime configuration.Returns the name to use in logging messages.Return the type of task.protected RuntimeConfigurableReturn the runtime configurable structure for this task.protected voidhandleErrorFlush(String output) Handles an error line by logging it with the WARN priority.protected voidhandleErrorOutput(String output) Handles an error output by logging it with the WARN priority.protected voidhandleFlush(String output) Handles output by logging it with the INFO priority.protected inthandleInput(byte[] buffer, int offset, int length) Handle an input request by this task.protected voidhandleOutput(String output) Handles output by logging it with the INFO priority.voidinit()Called by the project to let the task initialize properly.protected final booleanHas this task been marked invalid?voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidConfigures this task - if it hasn't been done already.final voidperform()Performs this task if it's still valid, or gets a replacement version and performs that otherwise.voidForce the task to be reconfigured from its RuntimeConfigurable.voidsetOwningTarget(Target target) Sets the target container of this task.voidSets the wrapper to be used for runtime configuration.voidsetTaskName(String name) Sets the name to use in logging messages.voidsetTaskType(String type) Sets the name with which the task has been invoked.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProjectModifier 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.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
-
KeySubst
public KeySubst()Deprecated.
-
-
Method Details
-
execute
-
setSrc
-
setDest
Deprecated.Set the destination file.- Parameters:
dest- the destination file
-
setSep
Deprecated.Sets the separator between name=value arguments in setKeys(). By default it is "*".- Parameters:
sep- the separator string
-
setKeys
Deprecated.Sets the keys. Format string is like this:name=value*name2=value
Names are case sensitive.
Use the setSep() method to change the * to something else if you need to use * as a name or value.
- Parameters:
keys- aStringvalue
-
main
-
replace
public static String replace(String origString, Hashtable<String, String> keys) throws BuildExceptionDeprecated.Does replacement on text using the hashtable of keys.- Parameters:
origString- an input stringkeys- mapping of keys to values- Returns:
- the string with the replacements in it.
- Throws:
BuildException- on error
-