com.ibm.websphere.ant.tasks

Class NLSEcho

  1. java.lang.Object
  2. extended byEcho
  3. extended bycom.ibm.websphere.ant.tasks.NLSEcho

  1. public class NLSEcho
  2. extends Echo
wsNLSEcho Task: This is a echo extension task to display translated messages. Also provides variable substitution in the message. Attributes: key Key to look for in resource bundle --- Not required bundle Resource bundle from where resource for key to be loaded - Not required message Default message - Required replace substitution arguments seperated by ";;" - Not required Usage: Examples: Above 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 replace takes parameter values seperated by ;;. In the above 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"/>
Version:
1.0
See Also:
Copyright IBM Corp. 2002 Source File: NLSEcho.java Creation Date: August 13, 2002

Field Summary

Modifier and Type Field and Description
  1. protected
  2. java.lang.String
bundle
  1. protected
  2. java.lang.String
key
  1. protected
  2. java.lang.Object[]
tokens

Constructor Summary

Constructor and Description
NLSEcho()

Method Summary

Modifier and Type Method and Description
  1. protected
  2. void
doTranslation()
Get translated message
  1. void
execute()
Execute the task
  1. protected
  2. java.lang.String
getBundle()
Returns the fileName.
  1. protected
  2. java.lang.String
getKey()
Returns the key.
  1. void
setBundle(java.lang.String bundle)
Set the file name to be used as resource bundle
  1. void
setKey(java.lang.String key)
key to be translated
  1. void
setReplace(java.lang.String str)
Replaces {x} with values specified
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

bundle

  1. protected java.lang.String bundle

key

  1. protected java.lang.String key

tokens

  1. protected java.lang.Object[] tokens

Constructor Detail

NLSEcho

  1. public NLSEcho()

Method Detail

setBundle

  1. public void setBundle(java.lang.String bundle)
Set the file name to be used as resource bundle

execute

  1. public void execute()
Execute the task

setKey

  1. public void setKey(java.lang.String key)
key to be translated

doTranslation

  1. protected void doTranslation()
Get translated message

getBundle

  1. protected java.lang.String getBundle( )
Returns the fileName.
Returns:
String

getKey

  1. protected java.lang.String getKey( )
Returns the key.
Returns:
String

setReplace

  1. public void setReplace(java.lang.String str)
Replaces {x} with values specified