Emmanuel BENOîT
3dc2f5b8d1
The registry can maintain a set of classes that contain annotated singletons corresponding to the components.
27 lines
No EOL
729 B
Java
27 lines
No EOL
729 B
Java
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 "";
|
|
|
|
} |