org.apache.velocity.tools.struts
Class MessageTool.TextKey

java.lang.Object
  extended byorg.apache.velocity.tools.struts.MessageTool.TextKey
Enclosing class:
MessageTool

public class MessageTool.TextKey
extends java.lang.Object

Helper class to simplify tool usage when retrieving no-arg messages from the default bundle that have periods in their key.

So instead of $text.get("forms.profile.title"),1 you can just type $text.forms.profile.title. Also, this lets you do things like:

   #set( $profiletext = $text.forms.profile )
   

$profiletext.title

$profiletext.subtitle

Since:
VelocityTools 1.2

Field Summary
private  java.lang.String key
           
private  MessageTool tool
           
 
Constructor Summary
MessageTool.TextKey(MessageTool tool, java.lang.String key)
           
 
Method Summary
 MessageTool.TextKey get(java.lang.String key)
          Appends a period and the new key to the current key and returns a new TextKey instance with the combined result as its key.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tool

private MessageTool tool

key

private java.lang.String key
Constructor Detail

MessageTool.TextKey

public MessageTool.TextKey(MessageTool tool,
                           java.lang.String key)
Method Detail

get

public MessageTool.TextKey get(java.lang.String key)
Appends a period and the new key to the current key and returns a new TextKey instance with the combined result as its key.


toString

public java.lang.String toString()


Copyright (c) 2003 Apache Software Foundation