com.evelopers.unimod.validation
Class ConsistencyCheckVisitor

java.lang.Object
  extended bycom.evelopers.unimod.validation.ConsistencyCheckVisitor
All Implemented Interfaces:
ModelVisitor
Direct Known Subclasses:
ConsistencyValidator

abstract class ConsistencyCheckVisitor
extends java.lang.Object
implements ModelVisitor

Visits every state and checks consistency of guard conditions set.


Constructor Summary
(package private) ConsistencyCheckVisitor()
           
 
Method Summary
protected  void checkState(State s)
          Checks consistency of State s.
protected abstract  void fireInconsistentGuardSet(StateMachine sm, Transition t1, Transition t2, Guard guard)
           
protected abstract  void fireRedundantElseTransitions(StateMachine sm, State state, Event e, int elseTransitionsNumber)
           
 void setSm(StateMachine sm)
           
 boolean visit(ModelElement e)
          Checks consistency of e and its descendants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsistencyCheckVisitor

ConsistencyCheckVisitor()
Method Detail

setSm

public void setSm(StateMachine sm)

visit

public boolean visit(ModelElement e)
              throws VisitorException
Checks consistency of e and its descendants. e should be instance of State.

Specified by:
visit in interface ModelVisitor
Parameters:
e - state to visit.
Returns:
Whether e is composite state and thus whether its descendants should be checked.
Throws:
VisitorException - if e or its descendants aren't instances of type State.

checkState

protected void checkState(State s)
                   throws VisitorException
Checks consistency of State s.

Parameters:
s - state, consistency of what should be checked.
Throws:
VisitorException - if any error occurs.

fireInconsistentGuardSet

protected abstract void fireInconsistentGuardSet(StateMachine sm,
                                                 Transition t1,
                                                 Transition t2,
                                                 Guard guard)

fireRedundantElseTransitions

protected abstract void fireRedundantElseTransitions(StateMachine sm,
                                                     State state,
                                                     Event e,
                                                     int elseTransitionsNumber)