Annotation Type Transition


@Retention(RUNTIME) @Target(METHOD) public @interface Transition
Annotation used on methods to indicate that the method handles a specific kind of event when in a specific state.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The self transition
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The id of the state or states that this handler applies to.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The id of the state the StateMachine should move to next after executing the annotated method.
    Specifies the ids of one or more events handled by the annotated method.
    int
    The weight used to order handler annotations which match the same event in the same state.
  • Field Details

  • Element Details

    • on

      String[] on
      Specifies the ids of one or more events handled by the annotated method. If not specified the handler method will be executed for any event.
      Returns:
      the ids of the handled events
      Default:
      {"*"}
    • in

      String[] in
      The id of the state or states that this handler applies to. Must be specified.
      Returns:
      the ids of the handled states
    • next

      String next
      The id of the state the StateMachine should move to next after executing the annotated method. If not specified the StateMachine will remain in the same state.
      Returns:
      the id of the next state
      Default:
      "__self__"
    • weight

      int weight
      The weight used to order handler annotations which match the same event in the same state. Transitions with lower weight will be matched first. The default weight is 0.
      Returns:
      the weight used to order the handler
      Default:
      0