|
22 | 22 | import java.lang.annotation.RetentionPolicy; |
23 | 23 | import java.lang.annotation.Target; |
24 | 24 |
|
| 25 | +/** |
| 26 | + * Annotation for binding data to dynamically generated endpoint classes |
| 27 | + * or methods. When applied to a class or method, it associates a unique |
| 28 | + * identifier ({@link #uid()}) and a JSON payload ({@link #json()}) with |
| 29 | + * the annotated element, enabling data-driven endpoint generation. |
| 30 | + * |
| 31 | + * <p>This annotation is typically used in conjunction with |
| 32 | + * {@code EndpointApiBuilder} to bind request data to dynamically |
| 33 | + * constructed Spring MVC controller classes or handler methods.</p> |
| 34 | + * |
| 35 | + * @author [@Loong Wan](https://github.com/loong10k) |
| 36 | + * @since 3.0.0 |
| 37 | + * @see org.springframework.bytebuddy.bytecode.EndpointApiBuilder |
| 38 | + * @see org.springframework.bytebuddy.bytecode.ReactiveHandlerBuilder |
| 39 | + */ |
25 | 40 | @Target({ ElementType.TYPE, ElementType.METHOD }) |
26 | 41 | @Retention(RetentionPolicy.RUNTIME) |
27 | 42 | @Documented |
28 | 43 | @Inherited |
29 | 44 | public @interface WebBound { |
30 | 45 |
|
| 46 | + /** |
| 47 | + * A unique identifier for the data binding, typically a primary key |
| 48 | + * or identifier used to look up data in the implementing handler. |
| 49 | + * |
| 50 | + * @return the unique identifier string, or an empty string by default |
| 51 | + */ |
31 | 52 | String uid() default ""; |
32 | 53 |
|
| 54 | + /** |
| 55 | + * A JSON-formatted string containing the data payload to be bound |
| 56 | + * to the annotated element. |
| 57 | + * |
| 58 | + * @return the JSON payload string, or {@code "{}"} by default |
| 59 | + */ |
33 | 60 | String json() default "{}"; |
34 | 61 |
|
35 | 62 | } |
0 commit comments