Annotation Type Bean


  • @Documented
    @Retention(RUNTIME)
    @Target({METHOD,ANNOTATION_TYPE,TYPE,FIELD})
    public @interface Bean

    Annotation used to configure a bean. Typically used in conjunction with Factory.

     @Factory
     public class MyFactory {
    
         @Bean
         public MyBean myBean() {
             // create the bean
         }
     }
    Since:
    1.0
    See Also:
    Factory
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String preDestroy  
      java.lang.Class<?>[] typed  
    • Element Detail

      • preDestroy

        java.lang.String preDestroy
        Returns:
        The method to invoke to destroy the bean
        Default:
        ""
      • typed

        java.lang.Class<?>[] typed
        Returns:
        Limits the types exposed by this been to the given type or types.
        Since:
        3.0.0
        Default:
        {}