|
2 | 2 | * #%L |
3 | 3 | * Commons Demo |
4 | 4 | * %% |
5 | | - * Copyright (C) 2020 - 2023 Flowing Code |
| 5 | + * Copyright (C) 2020 - 2024 Flowing Code |
6 | 6 | * %% |
7 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | 8 | * you may not use this file except in compliance with the License. |
|
29 | 29 |
|
30 | 30 | /** |
31 | 31 | * This annotation is used for configuring the source code URL in a {@link TabbedDemo}. If no {@code |
32 | | - * value} is specified, and the demo view is annotated with {@link GithubLink}, then the source URL |
33 | | - * defaults to the location of the annotated class under {@code src/test/java} and the branch is |
34 | | - * determined from the value of {@link GithubBranch} in the demo view class (if the annotation is |
35 | | - * present) or the containing package of the demo view class. If the source URL is defaulted and no |
36 | | - * {@code GithubBranch} annotation is present either in the demo view class or its containing |
37 | | - * package, then the branch defaults to {@code master}. |
| 32 | + * value} or {@code clazz} is specified, and the demo view is annotated with {@link GithubLink}, |
| 33 | + * then the source URL defaults to the location of the annotated class under {@code src/test/java} |
| 34 | + * and the branch is determined from the value of {@link GithubBranch} in the demo view class (if |
| 35 | + * the annotation is present) or the containing package of the demo view class. If the source URL is |
| 36 | + * defaulted and no {@code GithubBranch} annotation is present either in the demo view class or its |
| 37 | + * containing package, then the branch defaults to {@code master}. |
38 | 38 | * |
39 | 39 | * @author Javier Godoy / Flowing Code |
40 | 40 | */ |
|
47 | 47 |
|
48 | 48 | static final String DEFAULT_VALUE = "__DEFAULT__"; |
49 | 49 |
|
50 | | - /** A link to the source code, if different from the annotated class. */ |
| 50 | + /** |
| 51 | + * A link to the source code, if different from the annotated class. |
| 52 | + * <p> |
| 53 | + * It is an error if both {@code value} and {@link #clazz()} are specified. |
| 54 | + */ |
51 | 55 | String value() default GITHUB_SOURCE; |
52 | 56 |
|
| 57 | + /** |
| 58 | + * The class to display, if different from the annotated class. |
| 59 | + * <p> |
| 60 | + * It is an error if both {@link #value()} and {@code clazz} are specified. |
| 61 | + */ |
| 62 | + Class<?> clazz() default DemoSource.class; |
| 63 | + |
53 | 64 | /** |
54 | 65 | * The caption of the source tab (displayed if several sources are provided). Default to the file |
55 | 66 | * name. |
|
0 commit comments