org.deduced.validation.validator.rule
Class IsEnumerationValidRule
java.lang.Object
org.deduced.rule.DeductionRuleLibrary
org.deduced.validation.validator.rule.IsEnumerationValidRule
- All Implemented Interfaces:
- DeductionRuleAnalyzer<java.lang.Object>
public class IsEnumerationValidRule
- extends DeductionRuleLibrary
IsEnumerationValidRule validate if a reference to an enumeration type uses
the correct types and avoids invalid enumeration values.
- Author:
- Steve McDuff
| 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 |
IsEnumerationValidRule
public IsEnumerationValidRule()
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)
validateEnumeration
public static java.lang.String validateEnumeration(java.lang.Object value,
java.util.List<?> enumerationValues,
java.util.List<?> invalidValues,
java.lang.Boolean isNullValid,
PropertyCollection<?,?> enumerationType)
- validate if a type to reference is valid
- Parameters:
value - the value to referenceenumerationValues - the enumeration values that are currently validinvalidValues - the list of values that are considered invalid.isNullValid - flag indicating if the reference is allowed to be
null.enumerationType - the enumeration type being validated
- Returns:
- an error string based on the validation error. If the new type is
valid, a null string is returned.