org.deduced.validation.validator.rule
Class IsNullableValidRule
java.lang.Object
org.deduced.rule.DeductionRuleLibrary
org.deduced.validation.validator.rule.IsNullableValidRule
- All Implemented Interfaces:
- DeductionRuleAnalyzer<java.lang.Object>
public class IsNullableValidRule
- extends DeductionRuleLibrary
IsNullableValidRule is used to validate nullable properties to check whether
null is allowed or not.
- Author:
- Steve McDuff
Methods inherited from class org.deduced.rule.DeductionRuleLibrary |
addReferenceToList, and, bigger, biggerOrEqual, createDateIncrementList, createObject, createObjectsMatchingAllValues, createObjectsMatchingAllValues, debug, equalTo, fillList, filter, filterList, filterList, filterList, findParentOfType, formatDate, formatDate, formatTime, instanceOf, maximumCollection, maximumValue, merge, minimumCollection, minimumValue, not, or, property, same, smaller, smallerOrEqual, sum, sum |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IsNullableValidRule
public IsNullableValidRule()
analyzeRule
public java.lang.Object analyzeRule(java.lang.Object[] inputs,
RuleExecutionContext context,
PropertyCollection<?,?> collection,
PropertyCollection<?,?> rule)
- (non-Javadoc)
- Parameters:
inputs
- the array of inputscontext
- the rule execution contextcollection
- the collection on which the rule is executedrule
- the rule being executed
- Returns:
- the rule result
- See Also:
DeductionRuleAnalyzer.analyzeRule(java.lang.Object[],
org.deduced.RuleExecutionContext, org.deduced.PropertyCollection,
org.deduced.PropertyCollection)
validateNullableValue
public static java.lang.String validateNullableValue(java.lang.Object value,
java.lang.Boolean canBeNull)
- validate that a nullable value is valid based on the canBeNull flag.
- Parameters:
value
- the numeric valuecanBeNull
- flag indicating if the object can be null. If the flag
is null, then the object is allowed to be null.
- Returns:
- the validation error string. Null if the new value is valid.