Class Injection


  • public class Injection
    extends java.lang.Object
    A target and value to be injected. A target can be a field, method or constructor of the target class, and is left null when the value is a reference to the owner class when injecting non-static fields or methods.

    When the target is a method or constructor the order of the injections provided determines the order of the parameters.

    • Constructor Summary

      Constructors 
      Constructor Description
      Injection​(java.lang.reflect.AccessibleObject target, java.lang.Object value)
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.reflect.AccessibleObject getTarget()
      Returns the target.
      java.lang.Object getValue()
      Returns the value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Injection

        public Injection​(java.lang.reflect.AccessibleObject target,
                         java.lang.Object value)
        Constructs a new instance.
        Parameters:
        target - an AccessibleObject which will serve as the target, can be null
        value - a value to inject, can be null
    • Method Detail

      • getTarget

        public java.lang.reflect.AccessibleObject getTarget()
        Returns the target. If null the value represents the owner class of a non-static field or method.
        Returns:
        a target, can be null
      • getValue

        public java.lang.Object getValue()
        Returns the value.
        Returns:
        a value, can be null