org.deduced.validation.validator.rule
Class IsReferenceTypeValidRule
java.lang.Object
org.deduced.rule.DeductionRuleLibrary
org.deduced.validation.validator.rule.IsReferenceTypeValidRule
- All Implemented Interfaces:
- DeductionRuleAnalyzer<java.lang.Object>
public class IsReferenceTypeValidRule
- extends DeductionRuleLibrary
IsReferenceTypeValidRule validate if a reference respects certain rules about
the type that is allowed to be referenced.
- 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 |
IsReferenceTypeValidRule
public IsReferenceTypeValidRule()
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)
validateCreateType
public static java.lang.String validateCreateType(java.lang.Object value,
PropertyCollection<?,?> mustImplement,
java.util.List<?> invalidType,
java.lang.Boolean isNullValid)
- validate if a type to reference is valid
- Parameters:
value
- the value to referencemustImplement
- the type that must be implemented by this reference
typeinvalidType
- the list of types that are considered invalid for
referenceisNullValid
- flag indicating if the reference is allowed to be
null.
- Returns:
- an error string based on the validation error. If the new type is
valid, a null string is returned.