Annotation Type Reference


  • @Target(FIELD)
    public @interface Reference
    Marks the annotated field as being referenced in it's declaring class. A getter is generated in order to access the field. The Autowired annotation is added to the field automatically.

    Usage example:
     class MyPage {
       @Reference
       MyComponent component
     
       static class MyComponent {
         def void someMethod() {
         }
       }
     }
     
    Leads to:
     public class MyPage {
       public static class MyComponent {
         public void someMethod() {
         }
       }
     
       @Autowired
       private MyPage.MyComponent component;
     
       public MyPage.MyComponent getComponent() {
         return this.component;
       }
     }
     
    Since:
    2.0.0
    Author:
    Oliver Libutzki <[email protected]>