public class NLSEcho
extends org.apache.tools.ant.taskdefs.Echo
;;- Not required Usage:
Examples:
<wsNLSEcho key="ISUCCESS" bundle="installapps" message="Installing app successful" />
This will echo the message using resource bundle "installapps" with key ISUCCESS. If ISUCCESS is not present in resource bundlle or resource bundle is missing ,default message "Installing app successful" is printed.
Variable substitution can be done using {x} similar to MessageFormat
<wsNLSEcho key="ISUCCESS" bundle="installapps" message="Installing app {0} successful on {1}" replace="hello;;server1" />
replace takes parameter values seperated by ;;. In the preceding example {0} is replaced with "hello" and {1} is replaced with "server1"
To use this task in your build.xml, include the following taskdef:
<taskdef name="wsNLSEcho" classname="com.ibm.websphere.ant.tasks.NLSEcho"/>
Copyright IBM Corp. 2002
Source File: NLSEcho.java
Creation Date: August 13, 2002
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
bundle |
protected java.lang.String |
key |
protected java.lang.Object[] |
tokens |
Constructor and Description |
---|
NLSEcho() |
Modifier and Type | Method and Description |
---|---|
protected void |
doTranslation()
Get translated message
|
void |
execute()
Execute the task
|
protected java.lang.String |
getBundle()
Returns the fileName.
|
protected java.lang.String |
getKey()
Returns the key.
|
void |
setBundle(java.lang.String bundle)
Set the file name to be used as resource bundle
|
void |
setKey(java.lang.String key)
key to be translated
|
void |
setReplace(java.lang.String str)
Replaces {x} with values specified
|
addText, setAppend, setFile, setLevel, setMessage
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
protected java.lang.String bundle
protected java.lang.String key
protected java.lang.Object[] tokens
public void setBundle(java.lang.String bundle)
public void execute()
execute
in class org.apache.tools.ant.taskdefs.Echo
public void setKey(java.lang.String key)
protected void doTranslation()
protected java.lang.String getBundle()
protected java.lang.String getKey()
public void setReplace(java.lang.String str)