Interface Injector

All Known Subinterfaces:
Context
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Injector
Resolves and injects values into fields, methods and/or constructors annotated with Inject.
Since:
Oct-2024
Author:
brian.oliver
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    inject(T injectable)
    Resolves and injects values into the specified injectable object.
  • Method Details

    • inject

      <T> T inject(T injectable) throws InjectionException
      Resolves and injects values into the specified injectable object.

      When injection fails an InjectionException is thrown. For specific types of injection failures, an appropriate subclass of InjectionException, like UnsatisfiedDependencyException, will be thrown.

      Type Parameters:
      T - the type of object being injected
      Parameters:
      injectable - the object in which values are to be injected
      Returns:
      the injected object allowing for fluent-style method calls
      Throws:
      InjectionException - when injection fails