|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.milyn.cdr.ParameterAccessor
public abstract class ParameterAccessor
Accessor class for looking up profile specific attributes.
Profile specific parameters are stored under the "device-parameters" selector (seeSmooksResourceConfiguration). 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.
| Field Summary | |
|---|---|
static String |
GLOBAL_PARAMETERS
Device parameters .cdrl lookup string. |
| Constructor Summary | |
|---|---|
ParameterAccessor()
|
|
| Method Summary | |
|---|---|
static boolean |
getBoolParameter(String name,
boolean defaultVal,
ContentDeliveryConfig 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,
String defaultVal,
ContentDeliveryConfig config)
Get the named parameter String value. |
static void |
setParameter(String name,
String value,
Smooks smooks)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GLOBAL_PARAMETERS
| Constructor Detail |
|---|
public ParameterAccessor()
| Method Detail |
|---|
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 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 void setParameter(String name,
String value,
Smooks smooks)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||