Interface AerogelAutoModule
- All Known Implementing Classes:
AerogelAutoModuleImpl
A runtime extension for aerogel which can be used to deserialize bindings which were previously constructed using an
annotation processor. Decoders are discovered automatically using the SPI, but can be registered dynamically at
runtime as well. Once deserialized, bindings can freely be constructed or installed into injectors.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptiondev.derklaro.aerogel.registry.Registry.WithKeyMapping<String, AutoEntryDecoder> Get the decoder registry that is used by this module instance.deserializeBindings(@NotNull InputStream dataStream) Deserializes the bindings that are contained in the given data stream.deserializeBindings(@NotNull InputStream dataStream, @Nullable ClassLoader loader) Deserializes the bindings that are contained in the given data stream.static @NotNull AerogelAutoModuleConstructs a new instance of this module.
-
Method Details
-
newInstance
-
decoderRegistry
@NotNull dev.derklaro.aerogel.registry.Registry.WithKeyMapping<String, AutoEntryDecoder> decoderRegistry()Get the decoder registry that is used by this module instance. The registry can be used to register additional deserializers or unregister them as needed.- Returns:
- the decoder registry of this module instance.
-
deserializeBindings
@NotNull @NotNull LazyBindingCollection deserializeBindings(@NotNull @NotNull InputStream dataStream) Deserializes the bindings that are contained in the given data stream. The given input stream is closed automatically when this method completes.- Parameters:
dataStream- the data stream to decode.- Returns:
- the deserialized bindings contained in the given stream.
- Throws:
IllegalStateException- in case something goes wrong during binding deserialization.
-
deserializeBindings
@NotNull @NotNull LazyBindingCollection deserializeBindings(@NotNull @NotNull InputStream dataStream, @Nullable @Nullable ClassLoader loader) Deserializes the bindings that are contained in the given data stream. The given input stream is closed automatically when this method completes.- Parameters:
dataStream- the data stream to decode.loader- the class loader to use when decoding types.- Returns:
- the deserialized bindings contained in the given stream.
- Throws:
IllegalStateException- in case something goes wrong during binding deserialization.
-