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 newLocalisedString
which does not need localisation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalisedString
nonLoc(boolean b)
Creates aLocalisedString
for the designatedboolean
.static LocalisedString
nonLoc(byte b)
Creates aLocalisedString
for the designatedbyte
.static LocalisedString
nonLoc(char c)
Creates aLocalisedString
for the designatedchar
.static LocalisedString
nonLoc(double d)
Creates aLocalisedString
for the designateddouble
.static LocalisedString
nonLoc(float f)
Creates aLocalisedString
for the designatedfloat
.static LocalisedString
nonLoc(int i)
Creates aLocalisedString
for the designatedint
.static LocalisedString
nonLoc(long l)
Creates aLocalisedString
for the designatedlong
.static LocalisedString
nonLoc(short s)
Creates aLocalisedString
for the designatedshort
.static LocalisedString
nonLoc(Object o)
Creates aLocalisedString
for the designated object.static LocalisedString
nonLoc(String s)
Creates aLocalisedString
for the designated simple string.Object
toLocalisedString(LocalisationFactory locFac, Locale loc)
Gets the localised representation of the implementing object.String
toString()
-
-
-
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 newLocalisedString
which does not need localisation.- Parameters:
s
- The string not needing localisation.
-
-
Method Detail
-
nonLoc
public static LocalisedString nonLoc(String s)
Creates aLocalisedString
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 aLocalisedString
for the designatedlong
.- Parameters:
l
- Thelong
not needing localisation.- Returns:
- A
LocalisedString
for the designatedlong
.
-
nonLoc
public static LocalisedString nonLoc(int i)
Creates aLocalisedString
for the designatedint
.- Parameters:
i
- Theint
not needing localisation.- Returns:
- A
LocalisedString
for the designatedint
.
-
nonLoc
public static LocalisedString nonLoc(short s)
Creates aLocalisedString
for the designatedshort
.- Parameters:
s
- Theshort
not needing localisation.- Returns:
- A
LocalisedString
for the designatedshort
.
-
nonLoc
public static LocalisedString nonLoc(char c)
Creates aLocalisedString
for the designatedchar
.- Parameters:
c
- Thechar
not needing localisation.- Returns:
- A
LocalisedString
for the designatedchar
.
-
nonLoc
public static LocalisedString nonLoc(byte b)
Creates aLocalisedString
for the designatedbyte
.- Parameters:
b
- Thebyte
not needing localisation.- Returns:
- A
LocalisedString
for the designatedbyte
.
-
nonLoc
public static LocalisedString nonLoc(boolean b)
Creates aLocalisedString
for the designatedboolean
.- Parameters:
b
- Theboolean
not needing localisation.- Returns:
- A
LocalisedString
for the designatedboolean
.
-
nonLoc
public static LocalisedString nonLoc(float f)
Creates aLocalisedString
for the designatedfloat
.- Parameters:
f
- Thefloat
not needing localisation.- Returns:
- A
LocalisedString
for the designatedfloat
.
-
nonLoc
public static LocalisedString nonLoc(double d)
Creates aLocalisedString
for the designateddouble
.- Parameters:
d
- Thedouble
not needing localisation.- Returns:
- A
LocalisedString
for the designateddouble
.
-
nonLoc
public static LocalisedString nonLoc(Object o)
Creates aLocalisedString
for 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
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 beingLocalised
should use the designated localisation factory for automatic localisation.- Specified by:
toLocalisedString
in interfaceLocalisedString
- Parameters:
locFac
- The localisation factory to be used byLocalised
model objects. If this isnull
, do not localise the usedLocalised
attributes.loc
- The locale for which to get the localised string. If this isnull
, treat it likeLocale.ROOT
has been requested.- Returns:
- The localised (string) representation of the implementing object for the designated locale using the designated localisation factory if appropriate.
-
-