Annotation Interface Module


@Retention(RUNTIME) @Target(MODULE) public @interface Module

Indicates that a module is a Inverno module that must be processed during compilation in order to generate a module class.

By default, the class is generated in a package named after the module's name and the class name is the last part of the module's name starting with a capital letter. For instance, class com.example.foo.Foo is generated for module com.example.foo. In order for the module to be usable its package must be exported in the Java module.

In case of name conflict, it is possible to explicitly specify the name of the generated class.

By default, any Inverno module required by another Inverno module will be imported in that module which means that it will be instantiated in the module and its public beans made available for dependency injection. As a consequence, an enclosing bean must provide all the beans required by the modules it imports otherwise it won't be able to instantiate them. You can use includes and/or excludes values to control that behavior.

Since:
1.0
Author:
Jeremy Kuhn
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Indicates the name of the generated module class, defaults to the name of the module.
    List required Inverno modules that must be excluded from the generated module class by the Inverno compiler.
    List required Inverno modules that must be included in the generated module class by the Inverno compiler, if none are specified include all.
    Indicates the package in the module where to place source files generated by the Inverno compiler.
  • Element Details

    • className

      String className

      Indicates the name of the generated module class, defaults to the name of the module.

      Returns:
      The module's class name
      Default:
      ""
    • includes

      String[] includes

      List required Inverno modules that must be included in the generated module class by the Inverno compiler, if none are specified include all.

      Returns:
      A list of modules to include
      Default:
      {}
    • excludes

      String[] excludes

      List required Inverno modules that must be excluded from the generated module class by the Inverno compiler.

      Returns:
      A list of modules to exclude
      Default:
      {}
    • sourcePackage

      String sourcePackage

      Indicates the package in the module where to place source files generated by the Inverno compiler.

      Note that className() takes precedence in the generation of the module class.

      Returns:
      The package where to place generated source files.
      Default:
      ""