|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task org.apache.tools.ant.taskdefs.KeySubst
public class KeySubst
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.
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
KeySubst()
Deprecated. |
Method Summary | |
---|---|
void |
execute()
Deprecated. Do the execution. |
static void |
main(java.lang.String[] args)
Deprecated. A test method. |
static java.lang.String |
replace(java.lang.String origString,
java.util.Hashtable keys)
Deprecated. Does replacement on text using the hashtable of keys. |
void |
setDest(java.io.File dest)
Deprecated. Set the destination file. |
void |
setKeys(java.lang.String keys)
Deprecated. Sets the keys. |
void |
setSep(java.lang.String sep)
Deprecated. Sets the separator between name=value arguments in setKeys(). |
void |
setSrc(java.io.File s)
Deprecated. Set the source file. |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeySubst()
Method Detail |
---|
public void execute() throws BuildException
execute
in class Task
BuildException
- on errorpublic void setSrc(java.io.File s)
s
- the source filepublic void setDest(java.io.File dest)
dest
- the destination filepublic void setSep(java.lang.String sep)
sep
- the separator stringpublic void setKeys(java.lang.String keys)
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.
keys
- a String
valuepublic static void main(java.lang.String[] args)
args
- not usedpublic static java.lang.String replace(java.lang.String origString, java.util.Hashtable keys) throws BuildException
origString
- an input stringkeys
- mapping of keys to values
BuildException
- on error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |