Class DefaultAutoAnnotationRegistry

java.lang.Object
dev.derklaro.aerogel.auto.internal.runtime.DefaultAutoAnnotationRegistry
All Implemented Interfaces:
AutoAnnotationRegistry

@API(status=INTERNAL, since="1.0", consumers="dev.derklaro.aerogel.auto") public final class DefaultAutoAnnotationRegistry extends Object implements AutoAnnotationRegistry
A default implementation of an AutoAnnotationRegistry.
Since:
1.0
  • Field Details

  • Constructor Details

    • DefaultAutoAnnotationRegistry

      public DefaultAutoAnnotationRegistry()
      Constructs a new default factory and automatically registers all auto annotation entries.
  • Method Details

    • entries

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

      @NotNull public @NotNull AutoAnnotationRegistry unregisterReader(@NotNull @NotNull String name)
      Unregisters a reader by its name.
      Specified by:
      unregisterReader in interface AutoAnnotationRegistry
      Parameters:
      name - the name of the factory to unregister.
      Returns:
      the same instance as used to call the method, for chaining.
    • registerReader

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

      @NotNull public @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.
      Specified by:
      makeConstructors in interface AutoAnnotationRegistry
      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.
    • makeConstructors

      @NotNull public @NotNull Set<dev.derklaro.aerogel.binding.BindingConstructor> makeConstructors(@NotNull @NotNull ClassLoader loader, @NotNull @NotNull InputStream stream)
      Makes all binding constructors which were emitted to the target stream.
      Specified by:
      makeConstructors in interface AutoAnnotationRegistry
      Parameters:
      loader - the class loader to use when loading of classes is needed.
      stream - the input stream of the file to read from.
      Returns:
      all constructed bindings based on the file output.
    • installBindings

      public 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.
      Specified by:
      installBindings in interface AutoAnnotationRegistry
      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.