001package io.avaje.inject.spi;
002
003/** A Module containing dependencies that will be included in BeanScope. */
004public interface AvajeModule extends InjectExtension {
005
006  /** Empty array of strings. */
007  String[] EMPTY_STRINGS = {};
008
009  /**
010   * Return public classes of the beans that would be registered by this module.
011   *
012   * <p>This method allows code to use reflection to inspect the modules classes before the module
013   * is wired. This method is not required for DI wiring.
014   */
015  Class<?>[] classes();
016
017  /** Build all the beans. */
018  void build(Builder builder);
019
020  /** Return the type names of types this module explicitly provides to other modules. */
021  default String[] providesBeans() {
022    return EMPTY_STRINGS;
023  }
024
025  /** Return the type(s) of scopes that this module provides. */
026  default String[] definesScopes() {
027    return EMPTY_STRINGS;
028  }
029
030  /**
031   * Return the type names of types this module needs to be provided externally or via other
032   * modules.
033   */
034  default String[] requiresBeans() {
035    return EMPTY_STRINGS;
036  }
037
038  /** Return the type names of packages this module needs to be provided via other modules. */
039  default String[] requiresPackagesFromType() {
040    return EMPTY_STRINGS;
041  }
042
043  /** Marker for custom scoped modules. */
044  interface Custom extends AvajeModule {}
045}