Class Labels


  • public class Labels
    extends java.lang.Object
    Utility class for obtain the i18n of the labels.

    Author:
    Javier Paniza
    • Constructor Summary

      Constructors 
      Constructor Description
      Labels()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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 void put​(java.lang.String id, java.util.Locale locale, java.lang.String label)
      Add or change a label by locale.
      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.
      • put

        public static void put​(java.lang.String id,
                               java.util.Locale locale,
                               java.lang.String label)
        Add or change a label by locale.

        The result is not persistent, after reinit the application the changes are gone.

        Since:
        5.8
      • 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)
      • 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)