|
10 | 10 | /** |
11 | 11 | * Marks that an {@code interface} should be used as a redirect set. |
12 | 12 | * <br/><br/> |
13 | | - * The marked type must be an {@code interface} and must contain only {@code abstract class} definitions marked with {@link TypeRedirect}<br/> |
14 | 13 | * By convention the marked type's name should end with `RedirectSet`, or `Set` |
15 | 14 | * <br/><br/> |
16 | | - * A {@link RedirectSet} may contain any number of {@code interface}s, and/or {@code abstract class}es. That <b><i>must</i></b> be annotated with one of: {@link TypeRedirect}, {@link InterOwnerContainer}, or {@link IntraOwnerContainer}<br/> |
| 15 | + * A {@link RedirectSet} may contain any number of {@code interface}s, and/or {@code abstract class}es. These <b><i>must</i></b> be annotated with one of: {@link TypeRedirect}, {@link InterOwnerContainer}, or {@link IntraOwnerContainer}<br/> |
17 | 16 | * <ul> |
18 | 17 | * <li>An inner type must be an {@code interface} if its destination type is an {@code interface}</li> |
19 | 18 | * <li>An inner type must be an {@code abstract class} if its destination type is an {@code abstract class}</li> |
|
25 | 24 | * <li>A {@link InterOwnerContainer}'s dst type is {@link InterOwnerContainer#to()}</li> |
26 | 25 | * <li>A {@link IntraOwnerContainer}'s dst type is {@link IntraOwnerContainer#value()}</li> |
27 | 26 | * </ul> |
28 | | - * <p> |
29 | | - * <br/><br/> |
| 27 | + * |
| 28 | + * <h2>Redirect Set Inheritance</h2> |
| 29 | + * A {@link RedirectSet} may inherit from one or more {@link RedirectSet}s using java's {@code extends} syntax as normal. |
| 30 | + * This results in a derived type inheriting all the redirects from the super type(s).<br/> |
| 31 | + * <li>Redirects from an inherited {@link RedirectSet} can be overridden by redefining them within the derived type.</li> |
| 32 | + * <li>If {@link RedirectSet} {@code A extends B, C} the redirects from {@code C} will override those in {@code B}; |
| 33 | + * the resulting redirects will then be overridden by those in {@code A}</li> |
| 34 | + * |
| 35 | + * <h2>Redirect Chaining</h2> |
| 36 | + * All redirects within a {@link RedirectSet} (including all inheritance) apply as a single atomic step. For example if |
| 37 | + * {@code A} is redirected to {@code B}, and {@code B} to {@code A} the result will <b>always</b> be A and B swapping |
| 38 | + * and will never result in all As or all Bs |
| 39 | + * |
30 | 40 | * <h2>Example</h2> |
31 | 41 | * <pre>{@code |
32 | | - * @DasmRedirectSet |
| 42 | + * @RedirectSet |
33 | 43 | * interface ExampleSet { |
34 | 44 | * @TypeRedirect(from = @Ref(Foo.class), to = @Ref(Bar.class)) |
35 | 45 | * abstract class FooToBarRedirects { |
|
0 commit comments