|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cle.util.statemachine.StateMachineValidator
(Deterministic) Finite State Machine (FSM) rules:
1. FSMs can have only one begin state per execution. 2. States may only have one Transition per condition. This is guranteed by the implementation of this StateMachine component. 3. All non end States must have a Transition to at least one other State. 4. All states must be able to reach an end state in <= the total number of states.
StateMachine
, Serialized FormField Summary | |
protected boolean |
DEBUG
Set this to true for diagnostic messages |
protected StateMachine |
stateMachine
The FSM being validated |
protected java.util.Vector |
violations
A list of all the violations found for the StateMachine being validated. |
Constructor Summary | |
StateMachineValidator(StateMachine aStateMachine)
|
Method Summary | |
void |
debug(java.lang.String text)
a simple way to print some debug messages out |
java.lang.String |
generateViolationReport()
|
StateMachine |
getStateMachine()
|
java.util.Vector |
getViolations()
Returns a Vector of the StateMachineViolations that have been found during the validation of the StateMachine by an instance of the StateMachineValidator |
protected void |
registerViolation(State fromState,
State toState,
TransitionCondition condition,
java.lang.String violationCode,
java.lang.String specificMessage)
|
void |
runAllValidations()
Execute all the checks in this Validator. |
void |
setStateMachine(StateMachine sm)
|
void |
validateFinality()
This method checks the existence of a path from every state to to at least one final state in the StateMachine |
void |
validateTransitions()
This method ensures that: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected StateMachine stateMachine
protected java.util.Vector violations
protected boolean DEBUG
Constructor Detail |
public StateMachineValidator(StateMachine aStateMachine)
aStateMachine
- the state machine to be validatedMethod Detail |
public void setStateMachine(StateMachine sm)
public StateMachine getStateMachine()
public java.util.Vector getViolations()
public void runAllValidations()
DEVELOPMENT NOTE: Any new validations methods must be coded into this method.
public java.lang.String generateViolationReport()
public void validateTransitions()
1) a transition table exisits for state machines with > 1 process 2) for each state, a transition exisits for each available condition
public void validateFinality()
protected void registerViolation(State fromState, State toState, TransitionCondition condition, java.lang.String violationCode, java.lang.String specificMessage)
public void debug(java.lang.String text)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |