Class ModelLocalisation
java.lang.Object
de.aristaflow.adept2.model.common.ModelLocalisation
Class for localisation of constant strings in various models
(
de.aristaflow.adept2.model). These cannot be localised the usual way using resource
bundles since we may need all existing localisations for some use cases, e. g. all available
localisations of the instance name for a grouping worklist item have to be added to the
corresponding plugin data so that the user interface can decide later which one to use.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe index for localisations of check reports listing the elements affected by a check report entry.static final intThe index for localisations of check reports indicating no problems.static final intThe index for localisations of String representation for data typeany.static final intThe index for localisations of the instance name for a grouping item.static final intThe index for localisations indicating that a value has not been set. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int key) Gets all available localisation for the designated key.static Stringget(Collection<Locale> locales, int key) Gets the localisation for the designated locales for the designated key.static StringGets the localisation for the designated locale or an appropriate fallback locale for the designated key.
-
Field Details
-
NOT_SET
public static final int NOT_SETThe index for localisations indicating that a value has not been set. This is usually for a null value that (obviously) cannot have a localisation.- See Also:
-
GROUPING_ITEM_INSTANCE_NAME
public static final int GROUPING_ITEM_INSTANCE_NAMEThe index for localisations of the instance name for a grouping item. This usually refers the reader to the grouped items since their instance names cannot be aggregated.- See Also:
-
CHECK_REPORT_AFFECTED_ELEMENTS
public static final int CHECK_REPORT_AFFECTED_ELEMENTSThe index for localisations of check reports listing the elements affected by a check report entry.- See Also:
-
CHECK_REPORT_NO_PROBLEMS
public static final int CHECK_REPORT_NO_PROBLEMSThe index for localisations of check reports indicating no problems.- See Also:
-
DATA_TYPE_ANY
public static final int DATA_TYPE_ANYThe index for localisations of String representation for data typeany.- See Also:
-
-
Constructor Details
-
ModelLocalisation
public ModelLocalisation()
-
-
Method Details
-
get
Gets the localisation for the designated locale or an appropriate fallback locale for the designated key. If no appropriate locale is found or no locale contains a localisation for the designated key,nullwill be returned.- Parameters:
locale- The locale for which to get the localisation (or a fallback locale thereof).key- The key for which to get the localisation.- Returns:
- The localisation for the designated locale or an appropriate fallback locale for the
designated key or
nullif no appropriate locale is found or no locale contains a localisation for the key.
-
get
Gets the localisation for the designated locales for the designated key. If no locale contains a localisation for the designated key,nullwill be returned.- Parameters:
locales- The locales for which to get the localisation.key- The key for which to get the localisation.- Returns:
- The localisation for the designated locales for the designated key or
nullif no locale contains a localisation for the key.
-
get
Gets all available localisation for the designated key. If no locale contains a localisation for the designated key,nullwill be returned.- Parameters:
key- The key for which to get the localisations.- Returns:
- The localisations for the designated key or
nullif no locale contains a localisation for the key.
-