public abstract class ParameterAccessor extends Object
SmooksResourceConfiguration
). The parameter values are
stored in the <param> elements within this Content Delivery Resource definition.
This class iterates over the list of SmooksResourceConfiguration
elements targeted at the ExecutionContext
profile. It looks for a definition of the named
parameter. If the <param> has a type attribute the
ParameterDecoder
for that type can be applied to the attribute
value through the getParameterObject(String,org.milyn.delivery.ContentDeliveryConfig)
method,
returning whatever Java type defined by the ParameterDecoder
implementation. As an example, see TokenizedStringParameterDecoder
.Modifier and Type | Field and Description |
---|---|
static String |
GLOBAL_PARAMETERS
Device parameters .cdrl lookup string.
|
Constructor and Description |
---|
ParameterAccessor() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolParameter(String name,
boolean defaultVal,
ContentDeliveryConfig config)
Get the named SmooksResourceConfiguration parameter as a boolean.
|
static boolean |
getBoolParameter(String name,
boolean defaultVal,
Map<String,List<SmooksResourceConfiguration>> config)
Get the named SmooksResourceConfiguration parameter as a boolean.
|
static Parameter |
getParameter(String name,
Map<String,List<SmooksResourceConfiguration>> resourceConfigurations)
Get the named parameter from the supplied resource config map.
|
static Object |
getParameterObject(String name,
ContentDeliveryConfig config)
Get the named parameter instance (decode).
|
static Parameter |
getParamter(String name,
ContentDeliveryConfig config)
Get the named parameter.
|
static String |
getStringParameter(String name,
ContentDeliveryConfig config)
Get the named parameter String value.
|
static String |
getStringParameter(String name,
Map<String,List<SmooksResourceConfiguration>> resourceConfigurations)
Get the named parameter from the supplied resource config map.
|
static String |
getStringParameter(String name,
String defaultVal,
ContentDeliveryConfig config)
Get the named parameter String value.
|
static void |
removeParameter(String name,
Smooks smooks) |
static void |
setParameter(String name,
String value,
Smooks smooks) |
public static final String GLOBAL_PARAMETERS
public static Object getParameterObject(String name, ContentDeliveryConfig config)
name
- Parameter name.config
- Device Delivery Configuration.public static String getStringParameter(String name, ContentDeliveryConfig config)
name
- Name of parameter to get.config
- The ContentDeliveryConfig
for the requesting device.public static String getStringParameter(String name, String defaultVal, ContentDeliveryConfig config)
name
- Name of parameter to get.defaultVal
- Default value returned if the parameter is not defined.config
- The ContentDeliveryConfig
for the requesting device.public static boolean getBoolParameter(String name, boolean defaultVal, ContentDeliveryConfig config)
name
- Name of parameter to get.defaultVal
- The default value to be returned if there are no
parameters on the this SmooksResourceConfiguration instance, or the parameter is not defined.config
- The ContentDeliveryConfig
for the requesting device.public static boolean getBoolParameter(String name, boolean defaultVal, Map<String,List<SmooksResourceConfiguration>> config)
name
- Name of parameter to get.defaultVal
- The default value to be returned if there are no
parameters on the this SmooksResourceConfiguration instance, or the parameter is not defined.config
- The config map.public static Parameter getParamter(String name, ContentDeliveryConfig config)
ContentDeliveryConfig.getSmooksResourceConfigurations()
to get the configurations map and then passes that to
getParameter(String, java.util.Map)
, returning its return value.name
- Parameter name.config
- Device Delivery Configuration.public static Parameter getParameter(String name, Map<String,List<SmooksResourceConfiguration>> resourceConfigurations)
name
- The parameter name.resourceConfigurations
- The resource configuration map.public static String getStringParameter(String name, Map<String,List<SmooksResourceConfiguration>> resourceConfigurations)
name
- The parameter name.resourceConfigurations
- The resource configuration map.Copyright © 2020. All rights reserved.