org.deduced.validation.validator.rule
Class IsNullableValidRule

java.lang.Object
  extended by org.deduced.rule.DeductionRuleLibrary
      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deduced.rule.DeductionRuleLibrary
DeductionRuleLibrary.CompareResult
 
Constructor Summary
IsNullableValidRule()
           
 
Method Summary
 java.lang.Object analyzeRule(java.lang.Object[] inputs, RuleExecutionContext context, PropertyCollection collection, PropertyCollection rule)
          (non-Javadoc)
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.
 
Methods inherited from class org.deduced.rule.DeductionRuleLibrary
addReferenceToList, and, bigger, biggerOrEqual, clearPropertyCollection, createDateIncrementList, createObject, createObjectsMatchingAllValues, createObjectsMatchingAllValues, createObjectsMatchingAllValuesInOrderedList, createObjectsMatchingAllValuesInOrderedList, createOrReuseListToMatchType, debug, equals, equalTo, fillList, fillListWithSpecifiedTypes, fillOrderedList, fillOrderedListExtractMatchesValues, fillOrderedListWithSpecifiedTypes, filter, filterList, filterList, filterList, findParentOfType, formatDate, formatDate, formatTime, getModelFromCollection, getPropertyCollectionController, instanceOf, maximumCollection, maximumValue, merge, minimumCollection, minimumValue, not, or, property, removeAlreadyMatchedOrderedListValues, same, smaller, smallerOrEqual, sum, sum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsNullableValidRule

public IsNullableValidRule()
Method Detail

analyzeRule

public java.lang.Object analyzeRule(java.lang.Object[] inputs,
                                    RuleExecutionContext context,
                                    PropertyCollection collection,
                                    PropertyCollection rule)
(non-Javadoc)

Parameters:
inputs - the array of inputs
context - the rule execution context
collection - the collection on which the rule is executed
rule - 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 value
canBeNull - 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.