org.kite9.diagram.builders.formats.fsm
Class EnumWithAnnotationFSMDataProvider

java.lang.Object
  extended by org.kite9.diagram.builders.formats.fsm.EnumWithAnnotationFSMDataProvider
All Implemented Interfaces:
FSMDataProvider

public class EnumWithAnnotationFSMDataProvider
extends Object
implements FSMDataProvider

This class can be used where your state transition methods are annotated with custom before and after annotations.

Author:
robmoffat

Constructor Summary
EnumWithAnnotationFSMDataProvider(DiagramBuilder db, Field f, Class<? extends Enum<?>> enumClass, Class<? extends Annotation> beforeAnnotation, Class<? extends Annotation> afterAnnotation)
          Creates a FSMDataProvider which examines methods having a state change, and before / after state change annotations.
EnumWithAnnotationFSMDataProvider(NounFactory nf, ProjectModel pm, Field f, Class<? extends Enum<?>> enumClass, ClassLoader cl, Class<? extends Annotation> beforeAnnotation, String beforeField, Class<? extends Annotation> afterAnnotation, String afterField)
          This more involved constructor allows you to choose a noun factory and project model, and use annotation fields other than the default 'value' field.
 
Method Summary
protected  Transition createTransition(MemberHandle handle)
           
protected  SimpleNoun[] getDefinedNouns(Member m, Class<? extends Annotation> annotation, String field)
           
protected  Enum<?>[] getDefinedValues(AnnotatedElement m, Class<? extends Annotation> annotation, String field)
           
 SimpleNoun[] getStates()
           
protected  SimpleNoun getTransitionObject(Object m)
           
 Transition[] getTransitions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumWithAnnotationFSMDataProvider

public EnumWithAnnotationFSMDataProvider(DiagramBuilder db,
                                         Field f,
                                         Class<? extends Enum<?>> enumClass,
                                         Class<? extends Annotation> beforeAnnotation,
                                         Class<? extends Annotation> afterAnnotation)
Creates a FSMDataProvider which examines methods having a state change, and before / after state change annotations.

Parameters:
db - Diagram Builder (used for project model and noun factory)
f - Field which state change occurs on
enumClass - Class of the field
beforeAnnotation - Annotation used to mark up 'before' states (field containing those states is assumed to be an array of the enumeration, and called 'value'.
afterAnnotation - Annotation used to mark up 'after' states (field containing those states is assumed to be an array of the enumeration, and called 'value'.

EnumWithAnnotationFSMDataProvider

public EnumWithAnnotationFSMDataProvider(NounFactory nf,
                                         ProjectModel pm,
                                         Field f,
                                         Class<? extends Enum<?>> enumClass,
                                         ClassLoader cl,
                                         Class<? extends Annotation> beforeAnnotation,
                                         String beforeField,
                                         Class<? extends Annotation> afterAnnotation,
                                         String afterField)
This more involved constructor allows you to choose a noun factory and project model, and use annotation fields other than the default 'value' field.

Method Detail

getStates

public SimpleNoun[] getStates()
Specified by:
getStates in interface FSMDataProvider

getTransitions

public Transition[] getTransitions()
Specified by:
getTransitions in interface FSMDataProvider

createTransition

protected Transition createTransition(MemberHandle handle)

getDefinedNouns

protected SimpleNoun[] getDefinedNouns(Member m,
                                       Class<? extends Annotation> annotation,
                                       String field)

getDefinedValues

protected Enum<?>[] getDefinedValues(AnnotatedElement m,
                                     Class<? extends Annotation> annotation,
                                     String field)

getTransitionObject

protected SimpleNoun getTransitionObject(Object m)


Copyright © 2011. All Rights Reserved.