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 TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext componentContext) generateAction(ActionType actionType, String language) Creates aRESTActionTypebased on the specifiedActionTypeand localized using the specified language.generateActions(Collection<ActionType> actionTypes, String language) CreatesRESTActionTypes, localized using the specified language, based on the specifiedActionTypes.generateCondition(ConditionType conditionType, String language) Creates aRESTConditionTypebased on the specifiedConditionTypeand localized using the specified language.generateConditions(Collection<ConditionType> conditionTypes, String language) CreatesRESTConditionTypes, localized using the specified language, based on the specifiedConditionTypes.generateParameter(Parameter parameter, String language) Creates aRESTParameterbased on the specifiedParameterand localized using the specifiedResourceBundle.generateValueType(ValueType valueType, String language) Creates aRESTValueTypebased on the specifiedValueTypeand localized using the specified language.generateValueTypes(Collection<ValueType> valueTypes, String language) CreatesRESTValueTypes, localized using the specified language, based on the specifiedValueTypes.voidsetBundleContext(org.osgi.framework.BundleContext bundleContext) voidsetResourceBundleHelper(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) CreatesRESTConditionTypes, localized using the specified language, based on the specifiedConditionTypes.- Parameters:
conditionTypes- theConditionTypes to be localizedlanguage- the language to use to localizeConditionTypes- Returns:
- a collection of
RESTConditionTypes based on the specifiedConditionTypes and localized using the specified language
-
generateActions
public Collection<RESTActionType> generateActions(Collection<ActionType> actionTypes, String language) CreatesRESTActionTypes, localized using the specified language, based on the specifiedActionTypes.- Parameters:
actionTypes- theActionTypes to be localizedlanguage- the language to use to localizeActionTypes- Returns:
- a collection of
RESTActionTypes based on the specifiedActionTypes and localized using the specified language
-
generateCondition
Creates aRESTConditionTypebased on the specifiedConditionTypeand localized using the specified language.- Parameters:
conditionType- theConditionTypeto be localizedlanguage- the language to use to localizeConditionType- Returns:
- a
RESTConditionTypebased on the specifiedConditionTypeand localized using the specified language
-
generateAction
Creates aRESTActionTypebased on the specifiedActionTypeand localized using the specified language.- Parameters:
actionType- theActionTypeto be localizedlanguage- the language to use to localizeActionType- Returns:
- a
RESTActionTypebased on the specifiedActionTypeand localized using the specified language
-
generateParameter
Creates aRESTParameterbased on the specifiedParameterand localized using the specifiedResourceBundle.- Parameters:
parameter- theParameterto be localizedlanguage- the language- Returns:
- a
RESTParameterbased on the specifiedActionTypeand localized using the specifiedResourceBundle
-
generateValueTypes
public Collection<RESTValueType> generateValueTypes(Collection<ValueType> valueTypes, String language) CreatesRESTValueTypes, localized using the specified language, based on the specifiedValueTypes.- Parameters:
valueTypes- theValueTypes to be localizedlanguage- the language to use to localizeValueTypes- Returns:
- a collection of
RESTValueTypes based on the specifiedValueTypes and localized using the specified language
-
generateValueType
Creates aRESTValueTypebased on the specifiedValueTypeand localized using the specified language.- Parameters:
valueType- theValueTypeto be localizedlanguage- the language to use to localizeValueType- Returns:
- a
RESTValueTypebased on the specifiedValueTypeand localized using the specified language
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext) -
setResourceBundleHelper
-