Annotations, Enum, AspectJ and the State pattern

The combination of annotations and AspectJ is a hot topic worth exploring when using JSE 5.0. Recently we were discussing if this combination can be used to implement part of the State pattern. Even though I couldn’t think of any practical value for this, I implemented this code. The following code has meta-data associated with methods and this meta-data has the next state hardcoded in it. I have used Enum,annotations and AspectJ but I haven’t checked this for bugs. The State pattern example is the one by Robert C. Martin. See Aspect-Oriented Design Pattern Implementations for implementations of the GOF patterns using AOP.