com.jalios.util
Class LangProperty

java.lang.Object
  extended by com.jalios.util.LangProperty

public class LangProperty
extends Object

This class allow one to instanciate a property to be used at a later time in a localized message. Useful for nested property, use it as an another property argument for example. Example: With a properties file like this one:

  en.en: English
  en.fr: French
  en.lbl.myfield: My field numbered {0}
  en.msg.empty-field-ml: Field {0} must not be empty in {1}.
  fr.en: Anglais
  fr.fr: Français
  fr.lbl.myfield: Mon champ numéroté {0}
  fr.msg.empty-field-ml: Le champ {0} ne doit pas être vide en {1}.
 
This code:
   String fieldName = "myfield";
   String missingFieldLang = "fr";
 
   JcmsUtil.glp(userLang, "msg.empty-field-ml", 
                  new LangProperty(fieldName, new Integer(42)),
                  new LangProperty(missingFieldLang));
 
Would output those messages :
  • in english : Field My field numbered 42 must not be empty in French.
  • in french : Le champ Mon champ numéroté 42 ne doit pas être vide en Français.
  • Since:
    jcms-5.5.0
    Version:
    $Revision: 39292 $
    Author:
    Olivier Jaquemet

    Field Summary
    protected  Object[] arguments
               
    protected  String name
               
    static String REVISION
               
     
    Constructor Summary
    LangProperty(String name)
               
    LangProperty(String name, Object arg1)
               
    LangProperty(String name, Object[] arguments)
               
    LangProperty(String name, Object arg1, Object arg2)
               
    LangProperty(String name, Object arg1, Object arg2, Object arg3)
               
     
    Method Summary
     Object[] getArguments()
               
     String getName()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    REVISION

    public static final String REVISION
    See Also:
    Constant Field Values

    name

    protected final String name

    arguments

    protected final Object[] arguments
    Constructor Detail

    LangProperty

    public LangProperty(String name,
                        Object[] arguments)

    LangProperty

    public LangProperty(String name)

    LangProperty

    public LangProperty(String name,
                        Object arg1)

    LangProperty

    public LangProperty(String name,
                        Object arg1,
                        Object arg2)

    LangProperty

    public LangProperty(String name,
                        Object arg1,
                        Object arg2,
                        Object arg3)
    Method Detail

    getName

    public String getName()

    getArguments

    public Object[] getArguments()


    Copyright © 2001-2010 Jalios SA. All Rights Reserved.