Skip to content

keramiozsoy/java-custom-annotation-injection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

java-custom-annotation-injection

There is an example of Custom Injection in your class.

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface MyCustomInject {
    Class whichClass();
}

Usage

@MyCustomInject(whichClass = Dog.class)
public static Animal animal;

@MyCustomInject(whichClass = Horse.class)
public static Animal anotherAnimal;

Releases

No releases published

Packages

No packages published

Languages