Class NonLocalisedString
- java.lang.Object
-
- de.aristaflow.adept2.model.common.i18n.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 asLocalisedString.
-
-
Constructor Summary
Constructors Constructor Description NonLocalisedString(Object s)Creates a newLocalisedStringwhich does not need localisation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalisedStringnonLoc(boolean b)Creates aLocalisedStringfor the designatedboolean.static LocalisedStringnonLoc(byte b)Creates aLocalisedStringfor the designatedbyte.static LocalisedStringnonLoc(char c)Creates aLocalisedStringfor the designatedchar.static LocalisedStringnonLoc(double d)Creates aLocalisedStringfor the designateddouble.static LocalisedStringnonLoc(float f)Creates aLocalisedStringfor the designatedfloat.static LocalisedStringnonLoc(int i)Creates aLocalisedStringfor the designatedint.static LocalisedStringnonLoc(long l)Creates aLocalisedStringfor the designatedlong.static LocalisedStringnonLoc(short s)Creates aLocalisedStringfor the designatedshort.static LocalisedStringnonLoc(Object o)Creates aLocalisedStringfor the designated object.static LocalisedStringnonLoc(String s)Creates aLocalisedStringfor the designated simple string.ObjecttoLocalisedString(LocalisationFactory locFac, Locale loc)Gets the localised representation of the implementing object.StringtoString()
-
-
-
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 newLocalisedStringwhich does not need localisation.- Parameters:
s- The string not needing localisation.
-
-
Method Detail
-
nonLoc
public static LocalisedString nonLoc(String s)
Creates aLocalisedStringfor the designated simple string.- Parameters:
s- The string not needing localisation.- Returns:
- A
LocalisedStringfor the designated simple string.
-
nonLoc
public static LocalisedString nonLoc(long l)
Creates aLocalisedStringfor the designatedlong.- Parameters:
l- Thelongnot needing localisation.- Returns:
- A
LocalisedStringfor the designatedlong.
-
nonLoc
public static LocalisedString nonLoc(int i)
Creates aLocalisedStringfor the designatedint.- Parameters:
i- Theintnot needing localisation.- Returns:
- A
LocalisedStringfor the designatedint.
-
nonLoc
public static LocalisedString nonLoc(short s)
Creates aLocalisedStringfor the designatedshort.- Parameters:
s- Theshortnot needing localisation.- Returns:
- A
LocalisedStringfor the designatedshort.
-
nonLoc
public static LocalisedString nonLoc(char c)
Creates aLocalisedStringfor the designatedchar.- Parameters:
c- Thecharnot needing localisation.- Returns:
- A
LocalisedStringfor the designatedchar.
-
nonLoc
public static LocalisedString nonLoc(byte b)
Creates aLocalisedStringfor the designatedbyte.- Parameters:
b- Thebytenot needing localisation.- Returns:
- A
LocalisedStringfor the designatedbyte.
-
nonLoc
public static LocalisedString nonLoc(boolean b)
Creates aLocalisedStringfor the designatedboolean.- Parameters:
b- Thebooleannot needing localisation.- Returns:
- A
LocalisedStringfor the designatedboolean.
-
nonLoc
public static LocalisedString nonLoc(float f)
Creates aLocalisedStringfor the designatedfloat.- Parameters:
f- Thefloatnot needing localisation.- Returns:
- A
LocalisedStringfor the designatedfloat.
-
nonLoc
public static LocalisedString nonLoc(double d)
Creates aLocalisedStringfor the designateddouble.- Parameters:
d- Thedoublenot needing localisation.- Returns:
- A
LocalisedStringfor the designateddouble.
-
nonLoc
public static LocalisedString nonLoc(Object o)
Creates aLocalisedStringfor the designated object. Depending on the class of the object, some string manipulation or conversion may take place. For instance, usuallyObject.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
LocalisedStringwith a simple string representation for the designated object.
-
toLocalisedString
public Object toLocalisedString(LocalisationFactory locFac, Locale loc)
Description copied from interface:LocalisedStringGets the localised representation of the implementing object. The localisation should be for the designated locale, model objects beingLocalisedshould use the designated localisation factory for automatic localisation.- Specified by:
toLocalisedStringin interfaceLocalisedString- Parameters:
locFac- The localisation factory to be used byLocalisedmodel objects. If this isnull, do not localise the usedLocalisedattributes.loc- The locale for which to get the localised string. If this isnull, treat it likeLocale.ROOThas been requested.- Returns:
- The localised (string) representation of the implementing object for the designated locale using the designated localisation factory if appropriate.
-
-