Package com.simplj.di.annotations
Annotation Type Dependency
-
@Documented @Target(TYPE) @Retention(RUNTIME) public @interface Dependency
Use this annotation to define a class as dependency. Below are the options:`id` - can be used to assign an unique id against the dependency.
`initMethod` - can be used to specify the the class should be instantiated by a method instead of constructor.
`singleton` - can be used to modify the class's singleton behavior. Default: true
`isDefault` - if class is child of an interface/class and there can be multiple other types of same interface/class
then use this to mark this as the default implementation for the corresponding interface/class type.
Constraints:
1) Only one public constructor can be present if `initMethod` is not provided 2) `initMethod` must be present in the same class 3) `initMethod` must be static