public final class ModelHelper extends Object
| Modifier | Constructor and Description |
|---|---|
private |
ModelHelper() |
| Modifier and Type | Method and Description |
|---|---|
private static Object |
_emptyStringToNull(Object compareValue) |
private static boolean |
_evaluateCondition(DisableCondition condition,
Map<String,DefinitionAndValue> definitionAndValues,
Logger logger) |
private static boolean |
_evaluateConditionValue(Object value,
DisableCondition.OPERATOR operator,
Object compareValue) |
private static boolean |
_hasDisableConditions(DisableConditions disableConditions) |
private static Pair<Boolean,ElementDefinition> |
_isModelItemGroupActive(ModelItemGroup group,
Map<String,Object> values) |
static boolean |
evaluateDisableConditions(DisableConditions disableConditions,
Map<String,DefinitionAndValue> definitionAndValues,
Logger logger)
Recursively evaluate the
DisableConditions against the given values |
static boolean |
isGroupSwitchOn(ModelItem modelItem,
Map<String,Object> values)
Checks if this item is in a group with a switch on
|
static List<I18nizableText> |
validateValue(ElementDefinition definition,
Object value)
Validates the given value
|
static List<I18nizableText> |
validateValue(ElementDefinition definition,
Object value,
boolean checkEnumerated)
Validates the given value
|
private ModelHelper()
public static boolean isGroupSwitchOn(ModelItem modelItem, Map<String,Object> values)
modelItem - the item to checkvalues - all items' values to get switchers' valuesprivate static Pair<Boolean,ElementDefinition> _isModelItemGroupActive(ModelItemGroup group, Map<String,Object> values)
public static boolean evaluateDisableConditions(DisableConditions disableConditions, Map<String,DefinitionAndValue> definitionAndValues, Logger logger)
DisableConditions against the given valuesdisableConditions - the disable conditions to evaluatedefinitionAndValues - the values to evaluatelogger - the logger for disable conditions evaluation logsprivate static boolean _hasDisableConditions(DisableConditions disableConditions)
private static boolean _evaluateCondition(DisableCondition condition, Map<String,DefinitionAndValue> definitionAndValues, Logger logger)
private static boolean _evaluateConditionValue(Object value, DisableCondition.OPERATOR operator, Object compareValue)
private static Object _emptyStringToNull(Object compareValue)
public static List<I18nizableText> validateValue(ElementDefinition definition, Object value)
definition - The definition to use to validate the valuevalue - the value to validatepublic static List<I18nizableText> validateValue(ElementDefinition definition, Object value, boolean checkEnumerated)
definition - The definition to use to validate the valuevalue - the value to validatecheckEnumerated - true true to make sure that the item with an enumerator has its value in the enumerated values