Class KeySubst

All Implemented Interfaces:
Cloneable

@Deprecated public class KeySubst extends Task
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
  • Constructor Details

    • KeySubst

      public KeySubst()
      Deprecated.
  • Method Details

    • execute

      public void execute() throws BuildException
      Deprecated.
      Do the execution.
      Overrides:
      execute in class Task
      Throws:
      BuildException - on error
    • setSrc

      public void setSrc(File s)
      Deprecated.
      Set the source file.
      Parameters:
      s - the source file
    • setDest

      public void setDest(File dest)
      Deprecated.
      Set the destination file.
      Parameters:
      dest - the destination file
    • setSep

      public void setSep(String sep)
      Deprecated.
      Sets the separator between name=value arguments in setKeys(). By default it is "*".
      Parameters:
      sep - the separator string
    • setKeys

      public void setKeys(String keys)
      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 - a String value
    • main

      public static void main(String[] args)
      Deprecated.
      A test method.
      Parameters:
      args - not used
    • replace

      public static String replace(String origString, Hashtable<String,String> keys) throws BuildException
      Deprecated.
      Does replacement on text using the hashtable of keys.
      Parameters:
      origString - an input string
      keys - mapping of keys to values
      Returns:
      the string with the replacements in it.
      Throws:
      BuildException - on error