Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Icon

Questions or comments? Please use our dedicated forum.

Using Spring-API

To develop plugins integrating with Spring-API you will need to use IntelliJ IDEA Ultimate Edition version 13.1 (or higher).

  1. add $IDEA_HOME$/plugins/spring/spring-api.jar to your IntelliJ Platform SDK classpath (not to your plugin module's dependencies)
  2. add $IDEA_HOME$/lib/src/src_spring-openapi.zip to your IntelliJ Platform SDK sourcepath
  3. add <depends>com.intellij.spring</depends> to your plugin.xml to require "Spring Support" plugin to be activated.

Available extension points are defined in META-INF/plugin.xml of $IDEA_HOME$/plugins/spring/spring-core.jar.

Main concepts

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)).

How do I...

Spring Model

Obtain Spring Model by file, PsiElement, ..

See SpringManager#getSpringModel(s)...

Contribute implicit model(s)

See com.intellij.spring.SpringModelProvider to provide implicit filesets (e.g. provided by another framework in specific configuration file).

Contribute implicit beans

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).

XML Configuration

Add support for additional Spring namespace

See EP com.intellij.spring.dom.SpringCustomNamespaces, registered namespace-key must match the one registered with your DOM elements via @Namespace.

Code Configuration

IDE features

Add inspections to Spring Validator

Add additional inspections (e.g. for custom namespace) to Spring Validator (Settings|Compiler|Validation) via EP com.intellij.spring.SpringInspectionsRegistry$Contributor.

Configure Spring support for other frameworks

Use com.intellij.spring.facet.SpringConfigurator to provide "automatic" configuration when Spring facet is added via framework wizard.

  • No labels