Is there any way to register a custom PsiClsss as a spring bean?

Hi,

   Is there any way to register a custom PsiClsss as a spring bean? I want to registar the mapper interface of Mybatis as spring bean in my Mybatis Plugin.

2 comments

Hello,

while there is no existing official API (yet), you can use the following in IJ 13.

1) add $IDEA_HOME$/plugins/Spring/lib/spring-api.jar to your Plugin-SDK
2) register EP with name "com.intellij.spring.customComponentsDiscoverer" extending from "com.intellij.spring.model.SpringImplicitBeansProviderBase" in your own plugin.xml
3) use addImplicitBean(@NotNull Collection<CustomSpringComponent> components, @NotNull Module module,@NotNull String className, @NotNull String beanName) to create new implicit beans
4) return all implicit beans from #getImplicitBeans

Please be advised that this is not guaranteed to work in the future.

Best regards,
Yann

0

Thank you for your answer, Yann

Best regards,
Lin

0

Please sign in to leave a comment.