Class MLanguage

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_AD_Language, I_Persistent, Evaluatee, ImmutablePOSupport

public class MLanguage extends X_AD_Language implements ImmutablePOSupport
Language Model
Version:
$Id: MLanguage.java,v 1.4 2006/07/30 00:58:36 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, www.arhipac.ro
  • BF [ 2444851 ] MLanguage should throw an exception if there is an error
  • See Also:
    • Constructor Details

      • MLanguage

        public MLanguage(Properties ctx, String AD_Language_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        AD_Language_UU - UUID key
        trxName - Transaction
      • MLanguage

        public MLanguage(Properties ctx, int AD_Language_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Language_ID - id
        trxName - transaction
      • MLanguage

        public MLanguage(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MLanguage

        public MLanguage(Properties ctx, MLanguage copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MLanguage

        public MLanguage(Properties ctx, MLanguage copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • get

        public static MLanguage get(Properties ctx, Language lang)
        Get Language Model from Language (immutable)
        Parameters:
        ctx - context
        lang - language
        Returns:
        language
      • get

        public static MLanguage get(Properties ctx, String AD_Language)
        Get Language Model from AD_Language (immutable)
        Parameters:
        ctx - context
        AD_Language - language e.g. en_US
        Returns:
        language or null
      • getWithLanguage

        public static MLanguage[] getWithLanguage(Properties ctx, String LanguageISO)
        Load Languages via ISO code
        Parameters:
        ctx - context
        LanguageISO - language ISO code (2 letter) e.g. en
        Returns:
        array of MLanguage
      • maintain

        public static void maintain(Properties ctx)
        Maintain translation of all active languages
        Parameters:
        ctx - context
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_AD_Language
        Returns:
        info
      • getLocale

        public Locale getLocale()
        Get Locale
        Returns:
        Locale
      • getDateFormat

        public SimpleDateFormat getDateFormat()
        Get (Short) Date Format.
        Returns:
        date format MM/dd/yyyy - dd.MM.yyyy
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Description copied from class: PO
        Called before Save for Pre-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - true if it is a new record
        Returns:
        true if record can be saved
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        Description copied from class: PO
        Called after Save for Post-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - true if it is a new record
        success - true if save operation was success
        Returns:
        if save was a success
      • maintain

        public int maintain(boolean add)
        Maintain Translation
        Parameters:
        add - if true add missing records - otherwise delete
        Returns:
        number of records deleted/inserted
      • markImmutable

        public MLanguage markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO