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 void
activate(org.osgi.service.component.ComponentContext componentContext)
RESTActionType
generateAction(ActionType actionType, String language)
Creates aRESTActionType
based on the specifiedActionType
and localized using the specified language.Collection<RESTActionType>
generateActions(Collection<ActionType> actionTypes, String language)
CreatesRESTActionType
s, localized using the specified language, based on the specifiedActionType
s.RESTConditionType
generateCondition(ConditionType conditionType, String language)
Creates aRESTConditionType
based on the specifiedConditionType
and localized using the specified language.Collection<RESTConditionType>
generateConditions(Collection<ConditionType> conditionTypes, String language)
CreatesRESTConditionType
s, localized using the specified language, based on the specifiedConditionType
s.RESTParameter
generateParameter(Parameter parameter, String language)
Creates aRESTParameter
based on the specifiedParameter
and localized using the specifiedResourceBundle
.RESTValueType
generateValueType(ValueType valueType, String language)
Creates aRESTValueType
based on the specifiedValueType
and localized using the specified language.Collection<RESTValueType>
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)
-
-
-
Method Detail
-
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
public RESTConditionType generateCondition(ConditionType conditionType, String language)
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
public RESTActionType generateAction(ActionType actionType, String language)
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
public RESTParameter generateParameter(Parameter parameter, String language)
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
public RESTValueType generateValueType(ValueType valueType, String language)
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
public void setResourceBundleHelper(ResourceBundleHelper resourceBundleHelper)
-
-