Class LocalizationHelper
- java.lang.Object
-
- org.apache.unomi.rest.service.impl.LocalizationHelper
-
public class LocalizationHelper extends Object
A helper class to provide localized versions of context server entities.
-
-
Constructor Summary
Constructors Constructor Description LocalizationHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.osgi.service.component.ComponentContext componentContext)RESTActionTypegenerateAction(ActionType actionType, String language)Creates aRESTActionTypebased on the specifiedActionTypeand localized using the specified language.Collection<RESTActionType>generateActions(Collection<ActionType> actionTypes, String language)CreatesRESTActionTypes, localized using the specified language, based on the specifiedActionTypes.RESTConditionTypegenerateCondition(ConditionType conditionType, String language)Creates aRESTConditionTypebased on the specifiedConditionTypeand localized using the specified language.Collection<RESTConditionType>generateConditions(Collection<ConditionType> conditionTypes, String language)CreatesRESTConditionTypes, localized using the specified language, based on the specifiedConditionTypes.RESTParametergenerateParameter(Parameter parameter, String language)Creates aRESTParameterbased on the specifiedParameterand localized using the specifiedResourceBundle.RESTValueTypegenerateValueType(ValueType valueType, String language)Creates aRESTValueTypebased on the specifiedValueTypeand localized using the specified language.Collection<RESTValueType>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)
-
-
-
Method Detail
-
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
public RESTConditionType generateCondition(ConditionType conditionType, String language)
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
public RESTActionType generateAction(ActionType actionType, String language)
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
public RESTParameter generateParameter(Parameter parameter, String language)
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
public RESTValueType generateValueType(ValueType valueType, String language)
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
public void setResourceBundleHelper(ResourceBundleHelper resourceBundleHelper)
-
-