MyEclipse for Spring Reference – Annotators

1. Annotators in Spring Development

Annotators are part of the code assistants available in  MyEclipse with Spring support, and annotators help developers with annotation-based  development. While most Java developers understand how to technically use  Java annotations, it’s not always clear which annotations are available  for a specific technology and when a particular annotation should be used.  For example, the Spring framework has excellent support for  annotation-based programming; however there are a lot of supported  annotations. Some annotations are applicable to all Spring stereotypes,  and other annotations are applicable only to specific stereotypes.  Annotators support annotation-based development by helping a developer  understand what annotations are available and in what context the  annotation should be used.

Note: Spring scaffolding requires a MyEclipse Spring or Bling subscription.


2. Spring Annotator

The Spring Annotator guides you with configuring Spring stereotyped components, including controller, service, component and repository.

2.1 Spring Controller Annotator

The Spring Controller Annotator is for configuring Spring controllers. The annotator shows annotation and configuration options relevant to Spring @Controller.

2.1.1 Spring Controller – Class-level Annotations

When the class name is selected from the outline, the Controller tab lets you configure the class-level annotations for Spring controllers, and the Transactional tab lets you enable and configure the transactional properties of the controller.

Spring Annotations Controller tab

        2.1.2 Spring Controller – Variable-level Annotations

        When the class variable is selected from the outline, the Controller tab will let you configure the variable-level annotations for Spring controllers.

        Spring annotations controller variable annotation configuration

        2.1.3 Spring Controller – Method-level Annotations

        When the class method is selected from the outline, the Controller tab lets you configure the method-level annotations for Spring controllers, and the Transactional tab lets you enable and configure the transactional properties of the controller method.

        Spring annotations controller method annotation configuration

        2.2 Spring Service Annotator

        The Spring Service Annotator is for configuring Spring services. The annotator shows you annotation and configuration options relevant to Spring @Service.

        2.2.1 Spring Service – Class-level Annotations

        When the class name is selected from the outline, the Service tab lets you configure the class-level annotations for Spring services, and the Transactional tab lets you enable and configure the transactional properties of the service.

        Spring Annotations Service tab

          2.2.2 Spring Service – Variable-level Annotations

          When the class variable is selected from the outline, the Service tab lets you configure the variable-level annotations for Spring services.

          Spring annotations service variable annotation configuration

          2.2.3 Spring Service – Method-level Annotations

          When the class method is selected from the outline, the Service tab lets you enable and configure the transactional properties of Spring service methods.

          Spring annotations service method annotation configuration

          2.3 Spring Component Annotator

          The Spring Component Annotator is for configuring Spring components. The annotator shows you annotation and configuration options relevant to Spring @Component.

          2.3.1 Spring Component – Class-level Annotations

          When the class name is selected from the outline, the Component tab lets you configure the class-level annotations for Spring components, and the Transactional tab lets you enable and configure the transactional properties of the component.

          Spring Annotations Component tab

            2.3.2 Spring Component – Variable-level Annotations

            When the class variable is selected from the outline, the Component tab lets you configure the variable-level annotations for Spring components.

            Spring annotations component variable annotation configuration

            2.3.3 Spring Component – Method-level Annotations

            When the class method is selected from the outline, the Component tab lets you enable and configure the transactional properties of Spring component methods.

            Spring annotations component method annotation configuration

            2.4 Spring Repository Annotator

            The Spring Repository Annotator is for configuring Spring repositories. The annotator shows annotation and configuration options relevant to Spring @Repository.

            2.4.1 Spring Repository – Class-level Annotations

            When the class name is selected from the outline, the Repository tab lets you configure the class-level annotations for Spring repositories, and the Transactional tab lets you enable and configure the transactional properties of the repository.

            Spring Annotations Repository tab

              2.4.2 Spring Repository – Variable-level Annotations

              When the class variable is selected from the outline, the Repository tab lets you configure the variable-level annotations for Spring repositories.

              Spring annotations repository variable annotation configuration

              2.4.3 Spring Repository – Method-level Annotations

              When the class method is selected from the outline, the Component tab lets you enable and configure the transactional properties of Spring component methods.

              Spring annotations component method annotation configuration


              3. JAX-WS Annotator

              The JAX-WS Annotator is for configuring JAX-WS services. The annotator show annotation and configuration options that are relevant to JAX-WS.

              The JAX-WS annotator helps expose a Spring service (@Service) as a SOAP web service (often referred to as Contract-Last development or Code-First development), and the JAX-WS annotator also provides an Eclipse view for maintaining all JAX-WS web service annotations.

              3.1 JAX-WS – Class-level annotations – Web Service

              When the class name is selected from the outline, the Web Service tab lets you configure the class-level web service annotations for JAX-WS services.

              JAX-WS Annotations Web Service tab

              3.2 JAX-WS – Class-level annotations – SOAP Binding

              When the class name is selected from the outline, the SOAP Binding tab lets you configure the class-level SOAP binding annotations for JAX-WS services.

              JAX-WS Annotations SOAP Binding tab

              3.3 JAX-WS – Method-level annotations – Web Method

              When the class method is selected from the outline, the Web Method tab lets you configure the method-level Web Method annotations for JAX-WS services.

              JAX-WS Annotations Web Method tab

              3.4 JAX-WS – Method-level annotations – SOAP Binding

              When the class method is selected from the outline, the SOAP Binding tab lets you configure the method-level SOAP binding annotations for JAX-WS services.

              JAX-WS Annotations SOAP Binding tab

              3.5 JAX-WS – Method-level annotations – Request Wrapper

              When the class method is selected from the outline, the Request Wrapper tab lets you configure the method-level Request Wrapper annotations for JAX-WS services.

              JAX-WS Annotations Request Wrapper tab

              3.6 JAX-WS – Method-level annotations – Response Wrapper

              When the class method is selected from the outline, the Response Wrapper tab lets you configure the method-level Response Wrapper annotations for JAX-WS services.

              JAX-WS Annotations Response Wrapper tab

              3.7 JAX-WS – Method-level annotations – Parameters

              When the class method is selected from the outline, the Parameters tab lets you configure the method-level parameter annotations for JAX-WS services.

              JAX-WS Annotations Parameters tab

              3.8 JAX-WS – Method-level annotations – Web Result

              When the class method is selected from the outline, the Web Result tab lets you configure the method-level Web result annotations for JAX-WS services.

              JAX-WS Annotations Web Result tab


              4. JPA Annotator

              The JPA Annotator is for configuring JPA entities. The annotator shows annotation and configuration options that are relevant to JPA.

              4.1 JPA – Class-level annotations – Entity

              When the class name is selected from the outline, the Entity tab lets you configure the class-level annotations for JPA.

              JPA Annotations Entity tab

              4.2 JPA – Class-level annotations – Named Queries

              When the class name is selected from the outline, thee NamedQueries tab lets you configure the class-level annotations for JPA.

              JPA Annotations NamedQueries tab

              4.3 JPA – Class-level annotations – Named Native Queries

              When the class name is selected from the outline, the NamedNativeQueries tab lets you configure the class-level annotations for JPA.

              JPA Annotations NamedNativeQueries tab

              4.4 JAX-WS – JPA – Variable-level annotations – Basic

              When the class variable is selected from the outline, the editor lets you configure the variable-level.

              Configuring JPA basic variable-level annotations

              4.5 JPA – Variable-level annotations – Relationships

              When the class variable is selected from the outline, the editor lets you configure the variable-level.

              Configuring JPA annotations – relationships