Annotation Type Import


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface Import
    Allows importing an already compiled set of beans, placing any generating beans relative to the class where the import annotation is defined.

    Note that this annotation is likely to require more use of reflection if package protected members require injection.

    Since:
    3.0.0
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] annotated
      The annotations types to include in a search when specifying the packages() attribute (this attribute has no effect when combined with classes().
      java.lang.Class<?>[] classes  
      java.lang.String[] packages
      A list of package names to import.
    • Element Detail

      • classes

        java.lang.Class<?>[] classes
        Returns:
        The classes to import.
        Default:
        {}
      • packages

        java.lang.String[] packages
        A list of package names to import.

        Note that only types with a bean defining annotation will be imported.

        Returns:
        The packages to import.
        Default:
        {}
      • annotated

        java.lang.String[] annotated
        The annotations types to include in a search when specifying the packages() attribute (this attribute has no effect when combined with classes().

        If set to "*" will include all non-abstract classes. Defaults to only included types annotated with JSR-330 scopes or qualifiers.

        Returns:
        The annotation types
        Default:
        {"javax.inject.Scope", "javax.inject.Qualifier"}