org.openxava.util
Class Labels

java.lang.Object
  extended by org.openxava.util.Labels

public class Labels
extends java.lang.Object

Utility class for obtain the i18n of the labels.

Author:
Javier Paniza

Constructor Summary
Labels()
           
 
Method Summary
static boolean exists(java.lang.String id)
           
static boolean exists(java.lang.String id, java.util.Locale locale)
           
static boolean existsExact(java.lang.String id)
           
static boolean existsExact(java.lang.String id, java.util.Locale locale)
           
static java.lang.String get(java.lang.String id)
           
static java.lang.String get(java.lang.String id, java.util.Locale locale)
          On any error returns the sent id with the first letter in uppercase.
static java.lang.String get(java.lang.String id, java.util.Locale locale, java.lang.String defaultValue)
          If id is not found, or other error returns defaultValue
static java.lang.String getQualified(java.lang.String id)
          On any error returns the sent id with the first letter in uppercase.
static java.lang.String getQualified(java.lang.String id, java.util.Locale locale)
          On any error returns the sent id with the first letter in uppercase.
static java.lang.String getQualified(java.lang.String id, java.util.Locale locale, java.lang.String defaultValue)
          Qualified label.
static java.lang.String removeUnderlined(java.lang.String label)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Labels

public Labels()
Method Detail

getQualified

public static java.lang.String getQualified(java.lang.String id)
On any error returns the sent id with the first letter in uppercase.


getQualified

public static java.lang.String getQualified(java.lang.String id,
                                            java.util.Locale locale)
On any error returns the sent id with the first letter in uppercase.


get

public static java.lang.String get(java.lang.String id)

get

public static java.lang.String get(java.lang.String id,
                                   java.util.Locale locale)
On any error returns the sent id with the first letter in uppercase.


getQualified

public static java.lang.String getQualified(java.lang.String id,
                                            java.util.Locale locale,
                                            java.lang.String defaultValue)
Qualified label.

If you sent customer.warehouse.name it return "Name of Warehouse of Customer".
If id is not found, or other error returns defaultValue


get

public static java.lang.String get(java.lang.String id,
                                   java.util.Locale locale,
                                   java.lang.String defaultValue)
If id is not found, or other error returns defaultValue


exists

public static boolean exists(java.lang.String id)

existsExact

public static boolean existsExact(java.lang.String id)
                           throws XavaException
Throws:
XavaException

exists

public static boolean exists(java.lang.String id,
                             java.util.Locale locale)

existsExact

public static boolean existsExact(java.lang.String id,
                                  java.util.Locale locale)
                           throws XavaException
Throws:
XavaException

removeUnderlined

public static java.lang.String removeUnderlined(java.lang.String label)