ebul-cmp/src/main/java/info/ebenoit/ebul/cmp/ComponentSingleton.java

27 lines
729 B
Java
Raw Permalink Normal View History

package info.ebenoit.ebul.cmp;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation can be used to create automatically filled singleton fields that correspond to components. It can
* only be used on static, public fields.
* <p>
* If a string is given, it will be used as the component's name. Otherwise the component to fetch will be determined
* using the field's type.
*
* @author <a href="mailto:ebenoit@ebenoit.info">E. Benoît</a>
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.METHOD )
public @interface ComponentSingleton
{
public String value( ) default "";
}