Skip to content

Pityubak/AutoInjector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoInjector

Example library with Liberator

Overview

Here's example for usage:

  1. Create an interface:
public interface SomeMagic {
    void send(String msg);
}
  1. Implement the interface and here should be used the @Service annotation:
@Service
public class SomeMagicImpl implements SomeMagic {

    @Override
    public void send(String msg) {
        System.out.println(msg);
    }
    
}
  1. Inject with @AutoInject annotation:
    //case 1: just one class implements interface
    @AutoInject
    private SomeMagic magic;
    
    //case 2: more than one 
    @AutoInject(SomeMagicImpl.class)
    private SomeMagic pureMagic;
    

Example project:

AutoInjectorExample

About

Example library with Liberator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages