01: package tide.annotations;
02:
03: import java.lang.annotation.*;
04:
05: /** Marks the fact that the return value is THE instance of the class containing the method.
06: <code>
07: @ReturnInstanceRef()
08: public SomeAppendable append(String text)
09: {
10: // ...
11: return this; //same ref!
12: }
13: </code>
14: <br>
15: This is an important hint and contract that may (CURRENTLY NOT IMPL) be verified by static checkers.
16:
17: <br>
18: */
19: @Retention(RetentionPolicy.RUNTIME)
20: @Target(ElementType.METHOD)
21: public @interface ReturnInstanceRef {
22: //String value();
23: }
|