Injections

Field

public class ExampleService implements Service {

   @Autowired
   private Component dependency;

}

Constructor

public class ExampleService implements Service {

   private final Component dependency;

   @Autowired   
   public ExampleService(final Component component) {
      super();

      dependency = component;
   }

}

Setter

public class ExampleService implements Service {

   private Component dependency;

   @Autowired
   public void setDependency(final Component component) {
      dependency = component;
   }

}

Last updated