Mapping Rulebases to Components

Rulebases are associated with target components via regular expressions in a separate XML document. The default rulebase mapping file, rulebases.xml, specifies the relationship between rulebases, the validation document files that define them, and the target components they are associated with as a regular expression.

The example rulebase mapping below defines a rulebase named SwingAccessibility defined in the validation document swing_accessibility.xml. This rulebase will be applied to components that match either regular expression java\.awt\..+ or javax\.swing\..+.


<actf:rulebases 
    xmlns:actf="http://www.eclipse.org/projects/actf/validation"
    actf:version="0.1.0">
    
    <actf:rulebase
    
        actf:name="SwingAccessibility"
        actf:type="document"
        actf:location="swing_accessibility.xml"
        actf:rulebaseFactory="org.eclipse.actf.validation.rules.IRuleBaseFactory">
    
        <actf:target
            actf:regexp="java\.awt\..+"/>
    
        <actf:target
            actf:regexp="javax\.swing\..+"/>
    
    </actf:rulebase>
</actf:rulebases>