Examples of DefinitionError


Examples of au.com.ds.ef.err.DefinitionError

      // haven't started with this state yet
      states.add(state);
     
      if (state.isFinal()) {
        if (!state.getTransitions().isEmpty()) {
          throw new DefinitionError("Some events defined for final State: " + state);
        }
      } else {
        if (state.getTransitions().isEmpty()) {
          throw new DefinitionError("No events defined for non-final State: " + state);
        }
      }
     
      for (Map.Entry<Event<C>, State<C>> e : state.getTransitions().entrySet()) {
        Event<C> event = e.getKey();
        State<C> stateTo = e.getValue();
        if (state.equals(stateTo)) {
          throw new DefinitionError("Circular Event usage: " + event);
        }
        validate(stateTo);
      }
    }
  }
View Full Code Here

Examples of au.com.ds.ef.err.DefinitionError

    protected void addTransition(State<C> from, State<C> to) {
        State<C> existingTransitionState = transitions.get(from);
        if (existingTransitionState != null) {
            if (existingTransitionState == to) {
                throw new DefinitionError("Duplicate transition[" + this + "] from " + from + " to " + to);
            } else {
                throw new DefinitionError("Ambiguous transition[" + this + "] from " + from + " to " + to + " and " +
                    existingTransitionState);

            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.