info.magnolia.freemarker
Class MessagesWrapper

java.lang.Object
  extended by info.magnolia.freemarker.MessagesWrapper

public class MessagesWrapper
extends Object

Utility class that has methods which allow passing multiple parameters from a freemarker template to a message string using the square bracket syntax (e.g. ${i18n.get('message', ['param1', 'param2']}). There are convenience methods which allow selecting the message bundle directly from within the template as well (by passing the basename parameter), but using those methods removed fallback to default message bundles so they should be used only when such custom bundle contains all messages requested in given context.

Version:
$Id: $
Author:
vsteller
See Also:
info.magnolia.freemarker.FreemarkerHelperTest} for more syntax details.

Method Summary
 String get(String key)
           
 String get(String key, List args)
           
protected  String get(String key, List args, Messages messages)
           
 String get(String key, List args, String basename)
           
protected  String get(String key, Messages messages)
           
 String get(String key, String basename)
           
 String getWithDefault(String key, List args, String defaultMsg)
           
protected  String getWithDefault(String key, List args, String defaultMsg, Messages messages)
           
 String getWithDefault(String key, List args, String defaultMsg, String basename)
           
 String getWithDefault(String key, String defaultMsg)
           
protected  String getWithDefault(String key, String defaultMsg, Messages messages)
           
 String getWithDefault(String key, String defaultMsg, String basename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public String get(String key)

get

public String get(String key,
                  List args)

get

public String get(String key,
                  String basename)

get

public String get(String key,
                  List args,
                  String basename)

getWithDefault

public String getWithDefault(String key,
                             String defaultMsg)

getWithDefault

public String getWithDefault(String key,
                             String defaultMsg,
                             String basename)

getWithDefault

public String getWithDefault(String key,
                             List args,
                             String defaultMsg)

getWithDefault

public String getWithDefault(String key,
                             List args,
                             String defaultMsg,
                             String basename)

get

protected String get(String key,
                     Messages messages)

get

protected String get(String key,
                     List args,
                     Messages messages)

getWithDefault

protected String getWithDefault(String key,
                                String defaultMsg,
                                Messages messages)

getWithDefault

protected String getWithDefault(String key,
                                List args,
                                String defaultMsg,
                                Messages messages)


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