spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

how to programmably get the annotations on the spring boot main class

Open silentAllay opened this issue 10 years ago • 2 comments

assume I do not know the name of spring boot main class ,how to programmably get the annotations on the spring boot main class?

silentAllay avatar Sep 28 '16 07:09 silentAllay

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

wilkinsona avatar Sep 28 '16 08:09 wilkinsona

stackoverflow link: http://stackoverflow.com/questions/39741953/how-to-get-the-annotations-on-the-spring-boot-main-class-by-using-java-code I defined a custom annotation. people who use this annotation should put it on spring boot main class. when spring boot app is booting, I want to get this annotation like: spring_boot_main_clazz.getAnnotation(CustomAnnotation.class)‌​; But how can I get the spring_boot_main_clazz without knowing the exactly class name?

silentAllay avatar Sep 29 '16 10:09 silentAllay