
net.cassite.pure.ioc.annotations.Default Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pure.ioc Show documentation
Show all versions of pure.ioc Show documentation
Lightweight type and annotation based dependency injection framework
The newest version!
package net.cassite.pure.ioc.annotations;
import java.lang.annotation.*;
/**
* Annotation used to determine the default constructor, or the class
* redirected to.
* e.g.
* You have two constructors, both with parameters, it's ambiguous to determine
* which one to invoke.
* Use Default annotation to set a default one.
*
* e.g.
* You have an interface or abstract class, you want to construct an
* implementation, and there're a lot of work to do if you add Use annotation to
* each of setters. You can use Default on the interface or abstract class. The
* system would redirect the constructing target to the one you chose.
*
* @author wkgcass
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.CONSTRUCTOR})
@Inherited
public @interface Default {
/**
* redirect the construction to another class
*
* @return class
*/
@SuppressWarnings("rawtypes") Class value() default Default.class;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy