com.evelopers.unimod.validation
Class StructureValidator

java.lang.Object
  extended bycom.evelopers.unimod.validation.StructureVisitor
      extended bycom.evelopers.unimod.validation.StructureValidator

class StructureValidator
extends StructureVisitor

Validates structure (checks that every attainable composite state has initial state). Also validate that only root state machine has associations with EventProviderHandlers


Field Summary
protected  java.util.Set attainableStates
          Set of attainable states
protected  java.util.Set initialStateLess
          Set of attainable composite states which have no initial states
protected  java.util.Set notRootMachinesWithEventProviders
          Set of not root state machines that has associated event providers
protected  java.util.Map redundantInitStates
           
 
Constructor Summary
(package private) StructureValidator()
           
 
Method Summary
 boolean addStrucutreListener(StructureListener listener)
          Adds listener to list of structure listeners.
 java.util.Set getAttainableStates()
           
 java.util.Set getNoInitState()
          Returns set of attainable composite states which have no initial states.
 java.util.Set getNotRootMachinesWithEventProviders()
           
 java.util.Map getRedundantInitStates()
          Returns map of attainable composite states which have more then one initial state.
 boolean removeStrucutreListener(StructureListener listener)
          Removes listener from list of structure listeners.
 void validateStructure(StateMachine sm)
          Checks if every attainable composite state of sm has initial state.
 void visit(State state)
          Visits states and builds set of attainable states.
protected  void visitIncludedStateMachines(State state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attainableStates

protected java.util.Set attainableStates
Set of attainable states


initialStateLess

protected java.util.Set initialStateLess
Set of attainable composite states which have no initial states


redundantInitStates

protected java.util.Map redundantInitStates

notRootMachinesWithEventProviders

protected java.util.Set notRootMachinesWithEventProviders
Set of not root state machines that has associated event providers

Constructor Detail

StructureValidator

StructureValidator()
Method Detail

addStrucutreListener

public boolean addStrucutreListener(StructureListener listener)
Adds listener to list of structure listeners.

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

removeStrucutreListener

public boolean removeStrucutreListener(StructureListener listener)
Removes listener from list of structure listeners.

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

validateStructure

public void validateStructure(StateMachine sm)
Checks if every attainable composite state of sm has initial state. Every structure listener will be notified about every attainable composite state that has no initial substate.

Parameters:
sm - StateMachine to validate.

visit

public void visit(State state)
Visits states and builds set of attainable states.

Parameters:
state - state to visit.

visitIncludedStateMachines

protected void visitIncludedStateMachines(State state)

getNotRootMachinesWithEventProviders

public java.util.Set getNotRootMachinesWithEventProviders()

getAttainableStates

public java.util.Set getAttainableStates()
Returns:
Set of attainable states.

getNoInitState

public java.util.Set getNoInitState()
Returns set of attainable composite states which have no initial states.

Returns:
set of attainable composite states which have no initial states

getRedundantInitStates

public java.util.Map getRedundantInitStates()
Returns map of attainable composite states which have more then one initial state.

Returns:
map of attainable composite states which have more then one initial state