| |
|
| org.apache.tools.ant.Task org.apache.tools.ant.taskdefs.KeySubst
KeySubst | public class KeySubst extends Task (Code) | | 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 |
Method Summary | |
public void | execute() Do the execution. | public static void | main(String[] args) A test method. | public static String | replace(String origString, Hashtable keys) Does replacement on text using the hashtable of keys. | public void | setDest(File dest) Set the destination file. | public void | setKeys(String keys) Sets the keys. | public void | setSep(String sep) Sets the separator between name=value arguments
in setKeys(). | public void | setSrc(File s) Set the source file. |
main | public static void main(String[] args)(Code) | | A test method.
Parameters: args - not used |
replace | public static String replace(String origString, Hashtable keys) throws BuildException(Code) | | Does replacement on text using the hashtable of keys.
Parameters: origString - an input string Parameters: keys - mapping of keys to values the string with the replacements in it. throws: BuildException - on error |
setDest | public void setDest(File dest)(Code) | | Set the destination file.
Parameters: dest - the destination file |
setKeys | public void setKeys(String keys)(Code) | | 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 - a String value |
setSep | public void setSep(String sep)(Code) | | Sets the separator between name=value arguments
in setKeys(). By default it is "*".
Parameters: sep - the separator string |
setSrc | public void setSrc(File s)(Code) | | Set the source file.
Parameters: s - the source file |
|
|
|