Class TransitionAnnotationBeanPostProcessor
java.lang.Object
io.github.jspinak.brobot.annotations.TransitionAnnotationBeanPostProcessor
- All Implemented Interfaces:
BeanPostProcessor
@Component
public class TransitionAnnotationBeanPostProcessor
extends Object
implements BeanPostProcessor
BeanPostProcessor that detects and collects beans annotated with @TransitionSet.
This is necessary because Spring's getBeansWithAnnotation() method doesn't reliably detect beans with meta-annotations (like @TransitionSet which includes @Component).
This processor:
- Intercepts bean creation during Spring's initialization
- Checks if the bean's target class has @TransitionSet annotation
- Stores references to transition set beans for later processing
This approach is more reliable than getBeansWithAnnotation() for meta-annotations.
- Since:
- 1.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all collected beans.Get all collected TransitionSet beans.postProcessAfterInitialization
(Object bean, String beanName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessBeforeInitialization
-
Constructor Details
-
TransitionAnnotationBeanPostProcessor
public TransitionAnnotationBeanPostProcessor()
-
-
Method Details
-
postProcessAfterInitialization
- Specified by:
postProcessAfterInitialization
in interfaceBeanPostProcessor
- Throws:
BeansException
-
getTransitionSetBeans
Get all collected TransitionSet beans.- Returns:
- unmodifiable map of bean names to TransitionSet beans
-
clear
public void clear()Clear all collected beans. Useful for testing.
-