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.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      protected abstract boolean accept(java.lang.Object ref, java.lang.Object value)
      Accepts or rejects the value found in the referenced role.
      boolean check(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrConstraintValueChecker

        public IlrConstraintValueChecker()
    • Method Detail

      • check

        public boolean check(java.lang.Object value,
                             IlrSyntaxTree.Node node,
                             IlrValueError valueError)
        Description copied from interface: IlrValueChecker
        Checks 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:
        check in interface IlrValueChecker
        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 be null when no error message is reported.
        Returns:
        true if the given value is accepted, and false otherwise.
      • 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 not null.
        value - The actual value being checked.
        Returns:
        true to accept the value, false to reject it.

© Copyright IBM Corp. 1987, 2021