Questions or comments? Please use our dedicated forum. |
To develop plugins integrating with Spring-API you will need to use IntelliJ IDEA Ultimate Edition version 13.1 (or higher).
Please create a IntelliJ Platform SDK to include all minimum required files.
Then add $IDEA_HOME$/plugins/spring/spring.jar
to its classpath (not to your plugin module's dependencies).
Follow these steps to modify existing SDK:
$IDEA_HOME$/plugins/spring/spring-api.jar
$IDEA_HOME$/plugins/spring/spring.jar
$IDEA_HOME$/lib/src/src_spring-openapi.zip
If you use other Spring functionality (e.g. Spring EL) in your plugin, make sure to add all required JARs to your IntelliJ Platform SDK classpath to make your plugin's tests work.
Please use only Spring-related functionality exposed in |
Add <depends>com.intellij.spring</depends>
to your plugin.xml
to require "Spring Support" plugin to be activated. Navigate to target to see all available extension points.
Note that "Spring Support" plugin itself has dependencies to a few other plugins which need to be enabled in your sandbox (see notifications on startup).
A Spring facet can be attached on a Module.
Spring facets usually contain one more user-configured/provided filesets, which group a set of Spring related configuration files (XML, Code or .properties files).
A fileset usually corresponds to one actual application context configuration at runtime.
Filesets can depend on other filesets (possibly in another module).
As an API-user, you will usually rather work with SpringModel (which is built on top of fileset(s)).
Some core classes have been changed in 14, please see "Version 14" notes for info on how to replace existing API-calls |
See SpringManager#getSpringModel(s)...
and com.intellij.spring.model.utils.SpringModelUtils
.
See com.intellij.spring.SpringModelProvider
to provide implicit filesets (e.g. provided by another framework in specific configuration file).
See com.intellij.spring.model.jam.CustomComponentsDiscoverer
or com.intellij.spring.model.SpringImplicitBeansProviderBase
to provide implicit (framework-specific) beans (e.g. "servletContext" by Spring MVC).
Version 14
See com.intellij.spring.model.scope.SpringCustomBeanScope
to provide custom (e.g. framework specific) bean scopes.
Version 14.1
com.intellij.spring.profiles.SpringProfilesFactory
com.intellij.spring.CommonSpringModel#findBeanByName
Version 14: com.intellij.spring.model.utils.SpringModelSearchers#findBean
Choose one of com.intellij.spring.CommonSpringModel#findBeansByPsiClassXXX
variants.
Version 14: com.intellij.spring.model.utils.SpringModelSearchers#findBeans
Version 14: com.intellij.spring.model.utils.SpringModelSearchers#doesBeanExist
Version 14: implement SpringInfrastructureBean
All support for XML-based Spring configuration files is provided via DOM-API.
See EP com.intellij.spring.dom.SpringCustomNamespaces
, registered namespace-key must match the one registered with your DOM elements via @Namespace
.
Register available elements via standard DomExtender<Beans>
EP or com.intellij.spring.dom.SpringCustomNamespaces#registerExtensions
(Version 14).
Please pay attention to getModelVersion
and getStubVersion
(see javadoc).
Use the following template:
@Convert(SpringBeanResolveConverter.class) @RequiredBeanType("com.fqn.to.required.class") // optional GenericAttributeValue<SpringBeanPointer> getMyAttributeName(); |
Version 14
JamStringAttributeMeta.Single<SpringBeanPointer> ATTRIBUTE_META = JamAttributeMeta.singleString("attributeName", new SpringBeanReferenceJamConverter("com.my.required.Baseclass")); |
Add additional inspections (e.g. for custom namespace) to Spring Validator (Settings|Compiler|Validation) via EP com.intellij.spring.SpringInspectionsRegistry$Contributor
.
Version 14.1
Add additional configuration files to be processed by inspections registered with Spring Validator (e.g. .properties files) com.intellij.spring.SpringInspectionsRegistry$AdditionalFilesContributor
Use com.intellij.spring.facet.SpringConfigurator
to provide "automatic" configuration when Spring facet is added via framework wizard.
Please do not reference bean icons from SpringApiIcons
directly, but use SpringPresentationProvider
to get unified icon/bean name. See SpringBeansPsiElementCellRenderer
for popup/list renderer.