Interface Rule

All Superinterfaces:
CheckingNode
All Known Implementing Classes:
ConcurrentRule, OneByOneRule

public interface Rule
extends CheckingNode
The interface for rules.
Since:
9.10.2
  • Method Details

    • preCheck

      PreCheckResult preCheck​(ComponentSelector components)
      This method is called once before the actual checking of the components. The job of the pre check method is to select the components to be checked through the ComponentSelector parameter. Additionally, a PreCheckResult must be returned, reporting if the checking of this rule should continue to the next phase (with PreCheckResult.createRelevant()) or skipped (with PreCheckResult.createIrrelevant()). In both cases, a message can be added to document the result.
      Parameters:
      components - the CheckingSelection to mark components as checked
      Returns:
      a pre-check result
      Since:
      9.10.2
    • check

      void check​(CheckingSelection components, ResultFactory resultFactory)
      Called to implement the check phase. All the components selected during the pre check phase must be reported as checked through the CheckingSelection instance received as parameter, during the check phase.
      Parameters:
      components - the CheckingSelection to mark components as checked
      resultFactory - the result factory used to create results for this rule
      Since:
      9.10.2
    • postCheck

      default void postCheck()
      This is called once after the checking of components. Use cases: - post calculation for the checking - analysis of the results
      Since:
      9.10.2
    • getParametersUIDefinition

      default UIContainer getParametersUIDefinition()
      Returns the container that defines the UI for the parameters view of this rule.
      Returns:
      the container that defines the parameters view of this rule
      Since:
      9.10.2
    • getParent

      default Optional<CheckingNode> getParent()
      Description copied from interface: CheckingNode
      Returns the parent of this node, if one exists. Root nodes of a ruleset hierarchy do not have a parent, but all others do have a parent ruleset, or a parent rule.
      Specified by:
      getParent in interface CheckingNode
      Returns:
      the parent node
    • getChildren

      default List<CheckingNode> getChildren()
      Description copied from interface: CheckingNode
      Returns the children of this node.
      Specified by:
      getChildren in interface CheckingNode
      Returns:
      the child nodes
    • getName

      default String getName()
      Description copied from interface: CheckingNode
      Returns the name of this checking node. Note that the name might be translated into different languages and should not be used as an identifier as multiple rulesets or rules with the same name might exist.
      Specified by:
      getName in interface CheckingNode
      Returns:
      the name