[RSS]

Editor support in Spring beans configuration files

This page describes the editor support for Spring beans configuration files. For hyperlinking support in the editor, see SpringSupportNavigation.

Code completion

Every bean in a Spring beans configuration file references a Java class and its members. For example, the class attribute of the <bean> element holds the fully qualified name of the class which implements the bean. Code completion assists the users of Spring by providing all possible values for such classes and their entities, which greatly improves the productivity of the end user.

A detailed list of code completion scenarios is also available.

For the UI workflow regarding bean class' FQN completion, please refer SpringXMLClassPathCompletionUI

Another example is the smart code completion, which can:

  • suggest the name for a bean whose class is known according to the name of the bean class and the interfaces it implements (e.g., for a class named FooServiceImpl the smart code completion could offer fooService and foo as the bean name.
  • checks Java types for the ref attribute and constructor-ref element and suggests only the matching types.

Editor hints

Since a beans configuration file contains numerous references to the java sources in the project, there are possibilities of errors introduced due to references to non existing or altered entities. For example, a bean may refer a class which is not on the projects classpath. It is important to catch these errors before manual testing of the project. As the user edits the file, it is validated and error conditions, if any, are shown to the user with the help of editor annotations, and wherever possible, the user is given a suggestion to correct those errors. For example:

<bean id=”foo” class=”com.example.FooBar”/>

If the FooBar class does not exist on the project classpath, the user will be given a suggestion to create the class.

Detailed list of editor hints TBD.

Attachments

code_completion.PNG Info on code_completion.PNG 30697 bytes