Class BusinessRuleValidator

java.lang.Object
com.onec.rules.BusinessRuleValidator

public class BusinessRuleValidator extends Object
Evaluates a Validated entity's typed BusinessRules before write and before posting. Collects all failures (a field-scoped rule attaches to its field; a cross-field rule to the form) so the caller can report them together rather than one at a time. No expression parsing — the rules are plain Java predicates.
  • Constructor Details

    • BusinessRuleValidator

      public BusinessRuleValidator()
  • Method Details

    • collect

      public void collect(Object target, ValidationErrors errors)
      Collect every failing rule into errors (field- or form-scoped).
    • validate

      public void validate(Object target)
      Collect failures and throw a ValidationException if any.