Class NonLocalisedString

  • All Implemented Interfaces:
    LocalisedString

    public class NonLocalisedString
    extends Object
    implements LocalisedString
    Implementation to provide constant object (usually string)representations which do not need to be localised as LocalisedString.
    • Field Detail

      • s

        protected final Object s
        The object representation (usually a string) not needing localisation.
    • Constructor Detail

      • NonLocalisedString

        public NonLocalisedString​(Object s)
        Creates a new LocalisedString which does not need localisation.
        Parameters:
        s - The string not needing localisation.
    • Method Detail

      • nonLoc

        public static LocalisedString nonLoc​(String s)
        Creates a LocalisedString for the designated simple string.
        Parameters:
        s - The string not needing localisation.
        Returns:
        A LocalisedString for the designated simple string.
      • nonLoc

        public static LocalisedString nonLoc​(long l)
        Creates a LocalisedString for the designated long.
        Parameters:
        l - The long not needing localisation.
        Returns:
        A LocalisedString for the designated long.
      • nonLoc

        public static LocalisedString nonLoc​(int i)
        Creates a LocalisedString for the designated int.
        Parameters:
        i - The int not needing localisation.
        Returns:
        A LocalisedString for the designated int.
      • nonLoc

        public static LocalisedString nonLoc​(short s)
        Creates a LocalisedString for the designated short.
        Parameters:
        s - The short not needing localisation.
        Returns:
        A LocalisedString for the designated short.
      • nonLoc

        public static LocalisedString nonLoc​(char c)
        Creates a LocalisedString for the designated char.
        Parameters:
        c - The char not needing localisation.
        Returns:
        A LocalisedString for the designated char.
      • nonLoc

        public static LocalisedString nonLoc​(byte b)
        Creates a LocalisedString for the designated byte.
        Parameters:
        b - The byte not needing localisation.
        Returns:
        A LocalisedString for the designated byte.
      • nonLoc

        public static LocalisedString nonLoc​(boolean b)
        Creates a LocalisedString for the designated boolean.
        Parameters:
        b - The boolean not needing localisation.
        Returns:
        A LocalisedString for the designated boolean.
      • nonLoc

        public static LocalisedString nonLoc​(float f)
        Creates a LocalisedString for the designated float.
        Parameters:
        f - The float not needing localisation.
        Returns:
        A LocalisedString for the designated float.
      • nonLoc

        public static LocalisedString nonLoc​(double d)
        Creates a LocalisedString for the designated double.
        Parameters:
        d - The double not needing localisation.
        Returns:
        A LocalisedString for the designated double.
      • nonLoc

        public static LocalisedString nonLoc​(Object o)
        Creates a LocalisedString for the designated object. Depending on the class of the object, some string manipulation or conversion may take place. For instance, usually Object.toString() will be used, but depending on the class of the object, something different may be used, e. g. Arrays.toString(Object[]).
        Parameters:
        o - The object for which to get a simple string representation not needing localisation.
        Returns:
        A LocalisedString with a simple string representation for the designated object.
      • toLocalisedString

        public Object toLocalisedString​(LocalisationFactory locFac,
                                        Locale loc)
        Description copied from interface: LocalisedString
        Gets the localised representation of the implementing object. The localisation should be for the designated locale, model objects being Localised should use the designated localisation factory for automatic localisation.
        Specified by:
        toLocalisedString in interface LocalisedString
        Parameters:
        locFac - The localisation factory to be used by Localised model objects. If this is null, do not localise the used Localised attributes.
        loc - The locale for which to get the localised string. If this is null, treat it like Locale.ROOT has been requested.
        Returns:
        The localised (string) representation of the implementing object for the designated locale using the designated localisation factory if appropriate.