Interface AerogelAutoModule

All Known Implementing Classes:
AerogelAutoModuleImpl

@API(status=STABLE, since="3.0") public interface AerogelAutoModule
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 Details

    • newInstance

      @Contract(value=" -> new", pure=true) @NotNull static @NotNull AerogelAutoModule newInstance()
      Constructs a new instance of this module. During constructions the entry deserialized are discovered using SPI.
      Returns:
      a new instance of this module.
    • 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

      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

      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.