org.deduced.validation.validator.rule
Class IsReferenceTypeValidRule

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deduced.rule.DeductionRuleLibrary
DeductionRuleLibrary.CompareResult
 
Constructor Summary
IsReferenceTypeValidRule()
           
 
Method Summary
 java.lang.Object analyzeRule(java.lang.Object[] inputs, RuleExecutionContext context, PropertyCollection collection, PropertyCollection rule)
          (non-Javadoc)
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
 
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

IsReferenceTypeValidRule

public IsReferenceTypeValidRule()
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)

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 reference
mustImplement - the type that must be implemented by this reference type
invalidType - the list of types that are considered invalid for reference
isNullValid - 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.