Interface AutoAnnotationRegistry

All Known Implementing Classes:
DefaultAutoAnnotationRegistry

@API(status=STABLE, since="1.0") public interface AutoAnnotationRegistry
A runtime registry for readers of autoconfiguration file entries. A reader can either be registered through this registry directly or will be loaded automatically by using the java service api.
Since:
1.0
  • Method Details

    • newRegistry

      @NotNull static @NotNull AutoAnnotationRegistry newRegistry()
      Creates a new default implementation instance of an AutoAnnotationRegistry.
      Returns:
      a new default implementation instance.
    • entries

      @NotNull @NotNull @UnmodifiableView Map<String,AutoAnnotationReader> entries()
      An unmodifiable view of all the automated factories to load annotations.
      Returns:
      all the automated factories to load annotations.
    • unregisterReader

      @NotNull @NotNull AutoAnnotationRegistry unregisterReader(@NotNull @NotNull String name)
      Unregisters a reader by its name.
      Parameters:
      name - the name of the factory to unregister.
      Returns:
      the same instance as used to call the method, for chaining.
      Throws:
      NullPointerException - if name is null.
    • registerReader

      @NotNull @NotNull AutoAnnotationRegistry registerReader(@NotNull @NotNull AutoAnnotationReader reader)
      Registers a new reader if its name is not already present.
      Parameters:
      reader - the reader instance to register.
      Returns:
      the same instance as used to call the method, for chaining.
      Throws:
      NullPointerException - if name or entry is null.
    • makeConstructors

      @NotNull @NotNull Set<dev.derklaro.aerogel.binding.BindingConstructor> makeConstructors(@NotNull @NotNull ClassLoader loader, @NotNull @NotNull String fileName)
      Makes all binding constructors which were emitted to the target file.
      Parameters:
      loader - the loader in which the file resource is located.
      fileName - the name of the file resource to load.
      Returns:
      all constructed bindings based on the file output.
      Throws:
      dev.derklaro.aerogel.AerogelException - if an I/O exception occurs while loading or closing the data stream.
    • makeConstructors

      @NotNull @NotNull Set<dev.derklaro.aerogel.binding.BindingConstructor> makeConstructors(@NotNull @NotNull ClassLoader loader, @NotNull @NotNull InputStream emittedFile)
      Makes all binding constructors which were emitted to the target stream.
      Parameters:
      loader - the class loader to use when loading of classes is needed.
      emittedFile - the input stream of the file to read from.
      Returns:
      all constructed bindings based on the file output.
      Throws:
      dev.derklaro.aerogel.AerogelException - if an I/O exception occurs while loading, reading or closing the data stream.
    • installBindings

      void installBindings(@NotNull @NotNull ClassLoader loader, @NotNull @NotNull String fileName, @NotNull @NotNull dev.derklaro.aerogel.Injector target)
      Makes and installs all bindings which were emitted to the target file.
      Parameters:
      loader - the loader in which the file resource is located.
      fileName - the name of the file resource to load.
      target - the injector to install the bindings to.
      Throws:
      dev.derklaro.aerogel.AerogelException - if an I/O exception occurs while loading or closing the data stream.