info.magnolia.cms.i18n
Class MessagesUtil

java.lang.Object
  extended by info.magnolia.cms.i18n.MessagesUtil

public class MessagesUtil
extends Object

Util for handle messages. Allows easy use of chains and provides methods for rendering the javascript messages.

Version:
$Revision: 49481 $ ($Author: ndesmarais $)
Author:
Philipp Bracher

Constructor Summary
MessagesUtil()
           
 
Method Summary
static Messages chain(Messages msgs1, Messages msgs2)
           
static Messages chain(Messages msgs1, String basename)
           
static Messages chain(String[] basenames)
           
static Messages chain(String basename, Messages msgs2)
           
static Messages chainWithDefault(String basename)
           
static String generateJavaScript(Messages messages)
          Deprecated. since 4.0, use generateJavaScript(Writer out, Messages messages) instead.
static void generateJavaScript(Writer out, Messages messages)
          Adds Variables to a JS which can be used with the getMessage(key) method.
static String get(String key)
           
static String get(String key, String basename)
           
static String get(String key, String[] args)
           
static String get(String key, String basename, String[] args)
           
static String getChained(String key, String[] basenames)
           
static String getChained(String key, String[] basenames, String[] args)
           
static String getChainedWithDefault(String key, String dflt, String[] basenames)
           
static String getChainedWithDefault(String key, String dflt, String[] basenames, String[] args)
           
static String getWithDefault(String key, String dflt)
           
static String getWithDefault(String key, String dflt, String basename)
           
static String getWithDefault(String key, String dflt, String[] args)
           
static String getWithDefault(String key, String dflt, String basename, String[] args)
           
static String javaScriptString(String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagesUtil

public MessagesUtil()
Method Detail

generateJavaScript

public static String generateJavaScript(Messages messages)
Deprecated. since 4.0, use generateJavaScript(Writer out, Messages messages) instead.


generateJavaScript

public static void generateJavaScript(Writer out,
                                      Messages messages)
                               throws IOException
Adds Variables to a JS which can be used with the getMessage(key) method.

Throws:
IOException

chain

public static Messages chain(Messages msgs1,
                             Messages msgs2)

chain

public static Messages chain(String[] basenames)

chain

public static Messages chain(Messages msgs1,
                             String basename)

chain

public static Messages chain(String basename,
                             Messages msgs2)

chainWithDefault

public static Messages chainWithDefault(String basename)

javaScriptString

public static String javaScriptString(String msg)

get

public static String get(String key)

get

public static String get(String key,
                         String[] args)

getWithDefault

public static String getWithDefault(String key,
                                    String dflt)

getWithDefault

public static String getWithDefault(String key,
                                    String dflt,
                                    String[] args)

get

public static String get(String key,
                         String basename)

get

public static String get(String key,
                         String basename,
                         String[] args)

getWithDefault

public static String getWithDefault(String key,
                                    String dflt,
                                    String basename)

getWithDefault

public static String getWithDefault(String key,
                                    String dflt,
                                    String basename,
                                    String[] args)

getChained

public static String getChained(String key,
                                String[] basenames)

getChained

public static String getChained(String key,
                                String[] basenames,
                                String[] args)

getChainedWithDefault

public static String getChainedWithDefault(String key,
                                           String dflt,
                                           String[] basenames)

getChainedWithDefault

public static String getChainedWithDefault(String key,
                                           String dflt,
                                           String[] basenames,
                                           String[] args)


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.