Class LocalizationHelper
java.lang.Object
org.apache.unomi.rest.service.impl.LocalizationHelper
A helper class to provide localized versions of context server entities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(org.osgi.service.component.ComponentContext componentContext) generateAction
(ActionType actionType, String language) Creates aRESTActionType
based on the specifiedActionType
and localized using the specified language.generateActions
(Collection<ActionType> actionTypes, String language) CreatesRESTActionType
s, localized using the specified language, based on the specifiedActionType
s.generateCondition
(ConditionType conditionType, String language) Creates aRESTConditionType
based on the specifiedConditionType
and localized using the specified language.generateConditions
(Collection<ConditionType> conditionTypes, String language) CreatesRESTConditionType
s, localized using the specified language, based on the specifiedConditionType
s.generateParameter
(Parameter parameter, String language) Creates aRESTParameter
based on the specifiedParameter
and localized using the specifiedResourceBundle
.generateValueType
(ValueType valueType, String language) Creates aRESTValueType
based on the specifiedValueType
and localized using the specified language.generateValueTypes
(Collection<ValueType> valueTypes, String language) CreatesRESTValueType
s, localized using the specified language, based on the specifiedValueType
s.void
setBundleContext
(org.osgi.framework.BundleContext bundleContext) void
setResourceBundleHelper
(ResourceBundleHelper resourceBundleHelper)
-
Constructor Details
-
LocalizationHelper
public LocalizationHelper()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext componentContext) -
generateConditions
public Collection<RESTConditionType> generateConditions(Collection<ConditionType> conditionTypes, String language) CreatesRESTConditionType
s, localized using the specified language, based on the specifiedConditionType
s.- Parameters:
conditionTypes
- theConditionType
s to be localizedlanguage
- the language to use to localizeConditionType
s- Returns:
- a collection of
RESTConditionType
s based on the specifiedConditionType
s and localized using the specified language
-
generateActions
public Collection<RESTActionType> generateActions(Collection<ActionType> actionTypes, String language) CreatesRESTActionType
s, localized using the specified language, based on the specifiedActionType
s.- Parameters:
actionTypes
- theActionType
s to be localizedlanguage
- the language to use to localizeActionType
s- Returns:
- a collection of
RESTActionType
s based on the specifiedActionType
s and localized using the specified language
-
generateCondition
Creates aRESTConditionType
based on the specifiedConditionType
and localized using the specified language.- Parameters:
conditionType
- theConditionType
to be localizedlanguage
- the language to use to localizeConditionType
- Returns:
- a
RESTConditionType
based on the specifiedConditionType
and localized using the specified language
-
generateAction
Creates aRESTActionType
based on the specifiedActionType
and localized using the specified language.- Parameters:
actionType
- theActionType
to be localizedlanguage
- the language to use to localizeActionType
- Returns:
- a
RESTActionType
based on the specifiedActionType
and localized using the specified language
-
generateParameter
Creates aRESTParameter
based on the specifiedParameter
and localized using the specifiedResourceBundle
.- Parameters:
parameter
- theParameter
to be localizedlanguage
- the language- Returns:
- a
RESTParameter
based on the specifiedActionType
and localized using the specifiedResourceBundle
-
generateValueTypes
public Collection<RESTValueType> generateValueTypes(Collection<ValueType> valueTypes, String language) CreatesRESTValueType
s, localized using the specified language, based on the specifiedValueType
s.- Parameters:
valueTypes
- theValueType
s to be localizedlanguage
- the language to use to localizeValueType
s- Returns:
- a collection of
RESTValueType
s based on the specifiedValueType
s and localized using the specified language
-
generateValueType
Creates aRESTValueType
based on the specifiedValueType
and localized using the specified language.- Parameters:
valueType
- theValueType
to be localizedlanguage
- the language to use to localizeValueType
- Returns:
- a
RESTValueType
based on the specifiedValueType
and localized using the specified language
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext) -
setResourceBundleHelper
-