ilog.rules.brl.value.info
Class IlrConstraintValueChecker
- java.lang.Object
-
- ilog.rules.brl.value.info.IlrConstraintValueChecker
-
- All Implemented Interfaces:
- IlrValueChecker
public abstract class IlrConstraintValueChecker extends java.lang.Object implements IlrValueChecker
Implements a value checker that looks up for a constraint registered on a placeholder role to check if a given value complies with the constraint. A constraint value checker should be used on a phrase placeholer role.
-
-
Constructor Summary
Constructors Constructor and Description IlrConstraintValueChecker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description protected abstract booleanaccept(java.lang.Object ref, java.lang.Object value)Accepts or rejects the value found in the referenced role.booleancheck(java.lang.Object value, IlrSyntaxTree.Node node, IlrValueError valueError)Checks if the given value is acceptable in the given branch of the Abstract Syntax Tree.
-
-
-
Method Detail
-
check
public boolean check(java.lang.Object value, IlrSyntaxTree.Node node, IlrValueError valueError)Description copied from interface:IlrValueCheckerChecks if the given value is acceptable in the given branch of the Abstract Syntax Tree. This method is invoked when parsing the rule with values and concept instances used in the rule. This method is also invoked with concept instances only when building predictions in rule editors. In this case this checker is used to filter predicted concept instances and a null valueError is passed to this method.- Specified by:
checkin interfaceIlrValueChecker- Parameters:
value- The value which can be a literal or a Concept Instance.node- The parent node under which the value is added .valueError- The error that can be filled to parameterize the error message. That parameter can benullwhen no error message is reported.- Returns:
trueif the given value is accepted, andfalseotherwise.
-
accept
protected abstract boolean accept(java.lang.Object ref, java.lang.Object value)Accepts or rejects the value found in the referenced role. This method is called during the checking of the value.- Parameters:
ref- The referenced value associated to the referenced placeholder role in the Abstract Syntax Tree. This reference is notnull.value- The actual value being checked.- Returns:
trueto accept the value,falseto reject it.
-
-