GraphWalker/graphwalker-java — pull request #1 by KristianKarl (2014-09-08 14:39:23+00:00)
Title: Generate graphs from java classes

A java class, that implements Serializable, and using the @Transition
annotaion, can be used for creating graphs. A method annotated with
@Transition, needs accompanying method, with the same name, but
pre-fixed with the word "On"
Example:

public class Login implements Serializable {

// Types for each state variable
public enum Credentials { Valid, Invalid };
public enum Phase { Stopped, Starting, Started };

// State variables, initial state
public Credentials credentials = Credentials.Invalid;
public boolean rememberMe = false;
public Phase phase = Phase.Stopped;

@Transition
public void Start() {
if (rememberMe && credentials == Credentials.Valid) {
phase = Phase.Started;
public boolean OnRememberMe() {
return (phase == Phase.Starting);
}

@Transition
public void RememberMe() {
rememberMe = !rememberMe;
}

FsmFactory factory = new FsmFactory();
Model model = factory.create(new Login());