net.sf.staccatocommons.defs
Annotation Type Applicative


@Documented
@Retention(value=SOURCE)
@Target(value=TYPE)
public @interface Applicative

Applicable is an annotation for abstract types that have code-block/command/strategy/closure/lambda semantics, with an only abstract method that implements such code, called applicative method.

In order to remain as general purposes as possible, such types does not impose any Restriction over the type itself nor its applicative method. There are however some recommendations for implementing it, that will maximize the reusability of concrete classes.

Methods that return Applicatives must be NonNull and Transparent.

In addition, methods that return Applicatives and are annotated with restrictions, alter Restriction semantic in some way: they do not indicate that the method is restricted, but that the applicative's method is restricted. For example, in the following code:

 @Transparent
 Thunk<Integer> foo();
 
The Transparent annotations does not indicate that method foo() is transparent, but that the applicative method of the returned Thunks, that is, Thunk.value(), is transparent.

Author:
flbulgarelli



Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads