@Retention(value=RUNTIME) @Target(value={FIELD,PARAMETER}) @Documented @InjectionScope public @interface SideEffectFor
The type of the field must be of the same type as the SideEffect itself, or an InvocationHandler.
Example;
public interface MyStuff
{
SomeResult doSomething();
}
public class MyStuffSideEffect
implements MyStuff
{
@SideEffectFor MyStuff next;
public SomeResult doSomething()
{
SomeResult result = next.doSomething();
// HERE DO THE SIDEEFFECT STUFF.
return result; // Result value is ignored, null would work too.
}
}