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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new default factory and automatically registers all auto annotation entries. -
Method Summary
Modifier and TypeMethodDescription@NotNull @UnmodifiableView Map<String,AutoAnnotationReader> entries()An unmodifiable view of all the automated factories to load annotations.voidinstallBindings(@NotNull ClassLoader loader, @NotNull String fileName, @NotNull dev.derklaro.aerogel.Injector target) Makes and installs all bindings which were emitted to the target file.@NotNull Set<dev.derklaro.aerogel.binding.BindingConstructor>makeConstructors(@NotNull ClassLoader loader, @NotNull InputStream stream) Makes all binding constructors which were emitted to the target stream.@NotNull Set<dev.derklaro.aerogel.binding.BindingConstructor>makeConstructors(@NotNull ClassLoader loader, @NotNull String fileName) Makes all binding constructors which were emitted to the target file.@NotNull AutoAnnotationRegistryregisterReader(@NotNull AutoAnnotationReader entry) Registers a new reader if its name is not already present.@NotNull AutoAnnotationRegistryunregisterReader(@NotNull String name) Unregisters a reader by its name.
-
Field Details
-
entries
-
-
Constructor Details
-
DefaultAutoAnnotationRegistry
public DefaultAutoAnnotationRegistry()Constructs a new default factory and automatically registers all auto annotation entries.
-
-
Method Details
-
entries
An unmodifiable view of all the automated factories to load annotations.- Specified by:
entriesin interfaceAutoAnnotationRegistry- Returns:
- all the automated factories to load annotations.
-
unregisterReader
Unregisters a reader by its name.- Specified by:
unregisterReaderin interfaceAutoAnnotationRegistry- 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:
registerReaderin interfaceAutoAnnotationRegistry- 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:
makeConstructorsin interfaceAutoAnnotationRegistry- 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:
makeConstructorsin interfaceAutoAnnotationRegistry- 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:
installBindingsin interfaceAutoAnnotationRegistry- 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.
-