org.eclipse.actf.validation.core
Class AccessibilityValidationProcess

java.lang.Object
  extended by java.util.Observable
      extended by org.eclipse.actf.validation.core.AbstractValidationProcess
          extended by org.eclipse.actf.validation.core.AccessibilityValidationProcess
All Implemented Interfaces:
IValidationProcess

public class AccessibilityValidationProcess
extends AbstractValidationProcess

a validation process that walks a hierarchy of GUI components and validates each component with the appropriate validator. The GUI is traversed using classes in the org.eclipse.actf.model.traverse package.

Author:
John Buslawski
See Also:
ITreeNodeWalker

Field Summary
 
Fields inherited from class org.eclipse.actf.validation.core.AbstractValidationProcess
context, contextCache, execPoint, lastNotification, notificationIncrement, notificationPercent, progress, ruleBase, workEstimate
 
Constructor Summary
protected AccessibilityValidationProcess()
           
  AccessibilityValidationProcess(IRuleBase iRuleBase, ExecutionPoint execPoint, IValidationContext context)
           
 
Method Summary
protected  void calculateWork(ExecutionPoint execPoint, IRuleBase iRuleBase, IValidationContext context)
          visit the objects in the tree with the given target as the root.
protected  IValidationContext cloneContext(IRuleBase iRuleBase, IValidationContext context)
           
 void init()
          perform any initialization necessary for the process. prepares the IValidationContext and calculates initial work
protected  boolean pathMatchesExpression(Object target, String regexp)
          used by child classes within the model to determine if their path matches a reqular expression that identifies a rule base.
 void run()
          
protected  void validate(ExecutionPoint execPoint, IRuleBase ruleBase, IValidationContext context)
          validate the objects in the tree with the given target as the root.
protected  void validateChildren(Object target, ExecutionPoint execPoint, IRuleBase ruleBase, IValidationContext context, boolean validate)
          Validate the child components of the given target.
protected  void validateComponent(Object target, ExecutionPoint execPoint, IRuleBase ruleBase, IValidationContext context)
          used to validate single components.
protected  void visitComponent(Object target, ExecutionPoint execPoint, IRuleBase iRuleBase, IValidationContext context)
          used to visit a single component.
 
Methods inherited from class org.eclipse.actf.validation.core.AbstractValidationProcess
getExecutionPoint, getNotificationPercent, getProgress, getRuleBase, getValidationContext, getWorkEstimate, incrementProgress, initProgressEstimates, isTerminated, resetProgress, setExecutionPoint, setNotificationPercent, setProgress, setRuleBase, setValidationContext
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessibilityValidationProcess

public AccessibilityValidationProcess(IRuleBase iRuleBase,
                                      ExecutionPoint execPoint,
                                      IValidationContext context)

AccessibilityValidationProcess

protected AccessibilityValidationProcess()
Method Detail

init

public void init()
          throws ValidationProcessException
perform any initialization necessary for the process. For example, some implementations of this interface try to estimate the work in this method. prepares the IValidationContext and calculates initial work

Throws:
ValidationProcessException
See Also:
IValidationContext

run

public void run()
         throws ValidationProcessException

Throws:
ValidationProcessException

validate

protected void validate(ExecutionPoint execPoint,
                        IRuleBase ruleBase,
                        IValidationContext context)
                 throws ValidationProcessException
validate the objects in the tree with the given target as the root. All nodes should be instances of the appropriate type(s), which includes the primary type appropriate for the model and, optionally, a type that provides additional features and properties of the primary type, called its context.

Parameters:
execPoint - -- the ExecutionPoint that triggered this validation
ruleBase - -- the IRuleBase that matches this target
context - -- the IValidationContext to use when evaluating rules
Throws:
ValidationProcessException

validateComponent

protected void validateComponent(Object target,
                                 ExecutionPoint execPoint,
                                 IRuleBase ruleBase,
                                 IValidationContext context)
                          throws ValidationProcessException
used to validate single components.

Parameters:
target - -- the target object to validate
execPoint - -- the ExecutionPoint that triggered this validation
ruleBase - -- the IRuleBase that matches this target
context - -- the IValidationContext to use when evaluating rules
Throws:
ValidationProcessException

validateChildren

protected void validateChildren(Object target,
                                ExecutionPoint execPoint,
                                IRuleBase ruleBase,
                                IValidationContext context,
                                boolean validate)
                         throws ValidationProcessException
Validate the child components of the given target. The TreeWalkerFactory is used to get the appropriate tree walker, which fetches the children of this component.

Parameters:
target - -- the target object whose children are to be validated
execPoint - -- the ExecutionPoint that triggered this validation
ruleBase - -- the IRuleBase that matches this target
context - -- the IValidationContext to use when evaluating rules
validate - -- validate (true) or visit only
Throws:
ValidationProcessException

cloneContext

protected IValidationContext cloneContext(IRuleBase iRuleBase,
                                          IValidationContext context)
                                   throws ValidationProcessException
Parameters:
iRuleBase -
context -
Returns:
a clone of the context
Throws:
ValidationProcessException

pathMatchesExpression

protected boolean pathMatchesExpression(Object target,
                                        String regexp)
used by child classes within the model to determine if their path matches a reqular expression that identifies a rule base. This is typically needed when a child component has a

Parameters:
target - - target object we are trying to match
regexp - - the regular expression that identifies a rule base
Returns:
validator for this component

calculateWork

protected void calculateWork(ExecutionPoint execPoint,
                             IRuleBase iRuleBase,
                             IValidationContext context)
                      throws ValidationProcessException
visit the objects in the tree with the given target as the root. This method is used primarily to walk the component tree starting with the target and estimate the amount of work (or number of components) when the tree is walked.

Parameters:
execPoint - -- the ExecutionPoint that triggered this validation
iRuleBase - -- the IRuleBase that matches this target
context - -- the IValidationContext to use when evaluating rules
Throws:
ValidationProcessException

visitComponent

protected void visitComponent(Object target,
                              ExecutionPoint execPoint,
                              IRuleBase iRuleBase,
                              IValidationContext context)
                       throws ValidationProcessException
used to visit a single component.

Parameters:
target - -- the target object to validate
execPoint - -- the ExecutionPoint that triggered this validation
iRuleBase - -- the IRuleBase that matches this target
context - -- the IValidationContext to use when evaluating rules
Throws:
ValidationProcessException