com.evelopers.unimod.validation
Class CompletenessValidator

java.lang.Object
  extended bycom.evelopers.unimod.validation.CompletenessCheckVisitor
      extended bycom.evelopers.unimod.validation.CompletenessValidator
All Implemented Interfaces:
ModelVisitor

class CompletenessValidator
extends CompletenessCheckVisitor

Validates completeness (every state has complete system of transitions for every event).


Constructor Summary
(package private) CompletenessValidator()
           
 
Method Summary
 boolean addCompletenessListener(CompletenessListener listener)
          Adds listener to list of completeness listeners.
protected  void checkState(State state)
           
protected  void fireIncompleteGuardSet(StateMachine sm, State state, Event event, Guard guard)
           
 boolean removeCompletenessListener(CompletenessListener listener)
          Removes listener from list of completeness listeners.
 void setSm(StateMachine sm)
           
 void validateCompleteness(StateMachine sm)
          Checks completenes of transitions for set that is {state} joined with its descendants minus composite states.
 void validateCompleteness(StateMachine sm, State state)
          Check completeness for single state.
 boolean visit(ModelElement e)
          Called by ModelElement.accept(com.evelopers.unimod.core.ModelVisitor) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompletenessValidator

CompletenessValidator()
Method Detail

addCompletenessListener

public boolean addCompletenessListener(CompletenessListener listener)
Adds listener to list of completeness listeners.

Parameters:
listener - listener to add
Returns:
true (as List).
See Also:
CompletenessListener

removeCompletenessListener

public boolean removeCompletenessListener(CompletenessListener listener)
Removes listener from list of completeness listeners.

Parameters:
listener - listener to remove.
Returns:
true if list of listeners contained listener.
See Also:
CompletenessListener

validateCompleteness

public void validateCompleteness(StateMachine sm)
Checks completenes of transitions for set that is {state} joined with its descendants minus composite states. State is complete when state has complete guard conditions set for every event, i.e. for every combination of input actions values there is a transition. Every completeness listener will be notified about every incomplete system of transitions.

Parameters:
sm - StateMachine to validate.

validateCompleteness

public void validateCompleteness(StateMachine sm,
                                 State state)
Check completeness for single state.

Parameters:
state - non composite state

fireIncompleteGuardSet

protected void fireIncompleteGuardSet(StateMachine sm,
                                      State state,
                                      Event event,
                                      Guard guard)
Specified by:
fireIncompleteGuardSet in class CompletenessCheckVisitor

setSm

public void setSm(StateMachine sm)

visit

public boolean visit(ModelElement e)
              throws VisitorException
Description copied from interface: ModelVisitor
Called by ModelElement.accept(com.evelopers.unimod.core.ModelVisitor) method.

Specified by:
visit in interface ModelVisitor
Parameters:
e - model element to visit
Returns:
true if the model element members should be visited; false if they should be skipped
Throws:
VisitorException

checkState

protected void checkState(State state)
                   throws VisitorException
Throws:
VisitorException