예제 #1
0
 @Override
 public void visitOnEntry(ImmutableState<T, S, E, C> visitable) {
   if (visitable.isParallelState()) {
     writeLine("<parallel id= " + quoteName(visitable.toString()) + ">");
   } else {
     StringBuilder builder = new StringBuilder("<state id= ");
     builder.append(quoteName(visitable.toString()));
     if (visitable.getInitialState() != null) {
       builder.append(" initial= ").append(quoteName(visitable.getInitialState().toString()));
     }
     builder.append(">");
     writeLine(builder.toString());
   }
   if (!visitable.getEntryActions().isEmpty()) {
     writeLine("<onentry>");
     for (Action<T, S, E, C> entryAction : visitable.getEntryActions()) {
       writeAction(entryAction);
     }
     writeLine("</onentry>");
   }
   if (visitable.getHistoryType() != HistoryType.NONE) {
     writeLine(
         "<history type= " + quoteName(visitable.getHistoryType().name().toLowerCase()) + "/>");
   }
 }
예제 #2
0
 @Override
 public void visitOnExit(ImmutableState<T, S, E, C> visitable) {
   if (!visitable.getExitActions().isEmpty()) {
     writeLine("<onexit>");
     for (Action<T, S, E, C> exitAction : visitable.getExitActions()) {
       writeAction(exitAction);
     }
     writeLine("</onexit>");
   }
   if (visitable.isParallelState()) writeLine("</parallel>");
   else writeLine("</state>");
 }