Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
1 package org.apidesign.stateful.api;
3 import java.lang.annotation.Documented;
7 * @author Jaroslav Tulach <jtulach@netbeans.org>
9 // BEGIN: progress.annotations
10 public abstract class ProgressStateMachine {
11 /** Annotation that helps users and IDEs to understand what
12 * is the allowed order of method calls on instances of given class.
15 public @interface StateChange {
16 /** What is the required state of the object before given method
18 * @return "*" means any state, otherwise specify the state's name
20 String from() default "*";
21 /** The state object enters after the method successfully returns.
22 * @return name of new state
27 @StateChange(to="ready")
28 public static ProgressStateMachine create(String name) {
29 return createImpl(name);
32 @StateChange(from="ready", to="started")
33 public abstract void start(int totalAmount);
35 @StateChange(from="started", to="started")
36 public abstract void progress(int howMuch);
38 @StateChange(to="finished")
39 public abstract void finish();
40 // FINISH: progress.annotations
44 private static ProgressStateMachine createImpl(String name) {
45 return null; // implementation left out, similar to Progress.java