Class AppLanguages

  • All Implemented Interfaces:
    EventListener, IGProp<GProp<?>[]>, IPropCnr, java.lang.Cloneable

    public class AppLanguages
    extends PropCnr
    The configured languages for the application.
    Christopher Mindus
    • Constructor Detail

      • AppLanguages

        protected AppLanguages()
        Constructor without name.
    • Method Detail

      • addPredefinedProps

        protected void addPredefinedProps()
                                   throws PropException
        Adds the predefined properties for this container. This method is called once just after construction of the property container.
        addPredefinedProps in class PropCnr
        PropException - for property exceptions.
      • getPredefinedProps

        protected void getPredefinedProps()
        Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.

        The method should get reference to using the getProp(...) methods. This allows the subclass to be able to retrieve the new instances to the properties created during addPredefinedProps() if stored in instance variables.

        getPredefinedProps in class PropCnr
      • getDefaultLanguageCode

        public java.lang.String getDefaultLanguageCode()
        Gets the default language code defined when none is matching.
        The default language code to use (e.g. "en-US"), or null if none is defined.
      • setDefaultLanguageCode

        public boolean setDefaultLanguageCode​(java.lang.String lang)
        Sets the default language code.
        lang - The language code, or null or empty String to remove default.
        true for changed, false for no change.
      • mapLanguage

        public AppLanguages.Result mapLanguage​(java.lang.String languageCode)
        Maps a user language code to a Result.
        languageCode - The language code.
        The Result, never null.
      • getLanguageDefinitions

        public StringArrayProp getLanguageDefinitions()
        Gets the language map StringArrayProp that stores the language mappings as strings formatted as "lang{\t}useFor" where "lang" is the application-defined language, {\t} is the tab character and "useFor" is empty indicates the original language code being matched for, or a comma separated string of language codes with optional wildcards (* ?) that matches a particular language code to the application-defined language code.
      • getData

        public AppLanguages.Data getData()
        Gets a cached copy of (or builds) the language information from the language definitions.
        The AppLanguages data.