Annotation Type InjectIntoByType


  • @Target(FIELD)
    @Retention(RUNTIME)
    public @interface InjectIntoByType
    Annotation indicating that the the InjectModule should try to inject the object assigned to the annotated field to the object defined by the target attribute (or the object(s) assigned to the field annotated with TestedObject.

    Automatic injection by type is used, which means that the object is injected to the most specific property with an assignable type.

    Author:
    Filip Neven, Tim Ducheyne
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      PropertyAccess propertyAccess
      The property access that should be used for injection.
      String[] target
      The name of the field that references the object to which the object in the annotated field should be injected.
    • Element Detail

      • target

        String[] target
        The name of the field that references the object to which the object in the annotated field should be injected. If not specified, the target is defined by the field annotated with TestedObject
        Returns:
        the target field, null for tested object
        Default:
        {}
      • propertyAccess

        PropertyAccess propertyAccess
        The property access that should be used for injection.
        Returns:
        the access type, not null
        Default:
        org.unitils.inject.util.PropertyAccess.DEFAULT