Compound Rules

The <actf:or> and <actf:and> elements allow boolean expressions to be written in a validation document. These tags may appear only as child elements of a top-level component within a ruleset element (i.e.,<actf:ruleset>). For instance, this very simple example:


<actf:ruleset>
:
  <java.util.List>
    <actf:or actf:message="All lists must be either empty or contain exactly 5 elements">
      <size actf:eq="0"/>
      <size actf:eq="5"/>
    </actf:or>
  </java.util.List>
:
</actf:ruleset>
:

Here, we are verifying that all instances of java.util.List are either empty or have exactly five elements, as indicated by the message that will be printed upon failure. Individual messages may also be supplied for each of the disjuncts.)