@Deprecated public class EvaluationContext extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
DATE_OPERATION_PATTERN
Deprecated.
|
static String |
END_OF_EXPRESSION
Deprecated.
|
protected org.apache.commons.logging.Log |
log
Deprecated.
|
static String |
START_OF_EXPRESSION
Deprecated.
|
Constructor and Description |
---|
EvaluationContext()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addParameterValue(Parameterizable obj,
Parameter parameter,
Object value)
Deprecated.
Add a parameter to the context with the given value in the scope of the passed
Parameterizable object
|
void |
addParameterValue(Parameter parameter,
Object value)
Deprecated.
Add a parameter to the context with the given value with global scope
|
void |
addToCache(String key,
Object value)
Deprecated.
Add a value to the cache with a given key
|
void |
clearCache()
Deprecated.
Clear the entire cache
|
Object |
evaluateExpression(String expression)
Deprecated.
This method will parse the passed expression and return a value based on the following
criteria:
Any string that matches a parameter within the EvaluationContext will be replaced by the value of that parameter ** CURRENTLY REPLACEMENT PARAMETERS MUST EXIST IN THE GLOBAL SCOPE If this date is followed by an expression, it will attempt to evaluate this by incrementing/decrementing days/weeks/months/years as specified Examples: Given 2 parameters: report.startDate = java.util.Date with value of [2007-01-10] report.gender = "male" The following should result: |
Cohort |
getBaseCohort()
Deprecated.
|
Map<String,Object> |
getCache()
Deprecated.
Get the cache property
|
Object |
getFromCache(String key)
Deprecated.
Retrieve an entry from the cached with the given key
|
Parameter |
getParameter(Parameterizable obj,
String parameterName)
Deprecated.
Retrieve a Parameter by Name.
|
Object |
getParameter(String parameterName)
Deprecated.
Retrieve Parameter from Global Scope only.
|
Object |
getParameterValue(Parameter parameter)
Deprecated.
Retrieve parameter value in Global Scope only.
|
Object |
getParameterValue(Parameterizable obj,
Parameter parameter)
Deprecated.
Retrieve parameter value by Parameter.
|
Object |
getParameterValue(Parameterizable obj,
String parameterName)
Deprecated.
Retrieve parameter value by parameter name.
|
Object |
getParameterValue(String parameterName)
Deprecated.
Retrieve global parameter value by name
|
Map<Parameterizable,Map<Parameter,Object>> |
getParameterValues()
Deprecated.
Retrieve all parameter values
|
boolean |
isCached(String key)
Deprecated.
Return true if a cache entry exists with the given key
|
static boolean |
isExpression(String s)
Deprecated.
|
void |
removeFromCache(String key)
Deprecated.
Remove an entry cached with the given key
|
void |
setBaseCohort(Cohort baseCohort)
Deprecated.
|
void |
setCache(Map<String,Object> cache)
Deprecated.
Set the cache property
|
void |
setParameterValues(Map<Parameterizable,Map<Parameter,Object>> parameterValues)
Deprecated.
Set all parameter values
|
protected org.apache.commons.logging.Log log
public static final String START_OF_EXPRESSION
public static final String END_OF_EXPRESSION
public static final Pattern DATE_OPERATION_PATTERN
public static boolean isExpression(String s)
public void setCache(Map<String,Object> cache)
cache
- public void addToCache(String key, Object value)
public void removeFromCache(String key)
key
- public Object getFromCache(String key)
key
- public boolean isCached(String key)
key
- public void clearCache()
public void addParameterValue(Parameter parameter, Object value)
parameter
- value
- public void addParameterValue(Parameterizable obj, Parameter parameter, Object value)
obj
- Parametrizable
objectparameter
- value
- public Map<Parameterizable,Map<Parameter,Object>> getParameterValues()
public void setParameterValues(Map<Parameterizable,Map<Parameter,Object>> parameterValues)
parameterValues
- public Parameter getParameter(Parameterizable obj, String parameterName)
obj
- Parametrizable
object to get fromparameterName
- public Object getParameter(String parameterName)
parameterName
- String
name for parameter to getpublic Object getParameterValue(Parameterizable obj, Parameter parameter)
obj
- Parametrizable
objectparameter
- public Object getParameterValue(Parameter parameter)
parameter
- public Object getParameterValue(Parameterizable obj, String parameterName)
obj
- Parametrizable
objectparameterName
- key of the parameter to look forparameterName
public Object getParameterValue(String parameterName)
parameterName
- key of the parameter to look forparameterName
public Object evaluateExpression(String expression) throws ParameterException
evaluateExpression("${report.startDate}") -> "2007-01-10" as Date evaluateExpression("${report.startDate+5d}") -> "2007-01-15" as Date evaluateExpression("${report.startDate-1w}") -> "2007-01-03" as Date evaluateExpression("${report.startDate+3m}") -> "2007-04-15" as Date evaluateExpression("${report.startDate+1y}") -> "2008-01-10" as Date
expression
- Object
ParameterException
public Cohort getBaseCohort()
public void setBaseCohort(Cohort baseCohort)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.