public class

StateModelParser

extends Object
java.lang.Object
   ↳ org.apache.helix.participant.statemachine.StateModelParser

Class Overview

Finds the method in stateModel to generate

Summary

Public Constructors
StateModelParser()
Public Methods
String getInitialState(Class<? extends StateModel> clazz)
Get the initial state for the state model
Method getMethodForTransition(Class<? extends StateModel> clazz, String fromState, String toState, Class[]<?> paramTypes)
Method getMethodForTransitionByConvention(Class<? extends StateModel> clazz, String fromState, String toState, Class[]<?> paramTypes)
This class uses the method naming convention "onBecome" + toState + "From" + fromState;
Method getMethodForTransitionUsingAnnotation(Class<? extends StateModel> clazz, String fromState, String toState, Class[]<?> paramTypes)
This method uses annotations on the StateModel class.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StateModelParser ()

Public Methods

public String getInitialState (Class<? extends StateModel> clazz)

Get the initial state for the state model

public Method getMethodForTransition (Class<? extends StateModel> clazz, String fromState, String toState, Class[]<?> paramTypes)

public Method getMethodForTransitionByConvention (Class<? extends StateModel> clazz, String fromState, String toState, Class[]<?> paramTypes)

This class uses the method naming convention "onBecome" + toState + "From" + fromState;

Returns
  • Method if found else null

public Method getMethodForTransitionUsingAnnotation (Class<? extends StateModel> clazz, String fromState, String toState, Class[]<?> paramTypes)

This method uses annotations on the StateModel class. Use StateModelInfo annotation to specify valid states and initial value use Transition to specify "to" and "from" state

Parameters
clazz , class which extends StateModel