}
private static void setupSelfTransitions(Method m, Class<? extends Annotation> onEntrySelfTransitionAnnotation,
Class<? extends Annotation> onExitSelfTransitionAnnotation, Map<String, State> states, Object handler) {
if (m.isAnnotationPresent(OnEntry.class)) {
OnEntry onEntryAnnotation = (OnEntry) m.getAnnotation(onEntrySelfTransitionAnnotation);
State state = states.get(onEntryAnnotation.value());
if (state == null) {
throw new StateMachineCreationException("Error encountered "
+ "when processing onEntry annotation in method " + m + ". state " + onEntryAnnotation.value()
+ " not Found.");
}
state.addOnEntrySelfTransaction(new MethodSelfTransition(m, handler));
}