Skip to content

Commit 3031ef1

Browse files
committed
test: add JUnit tests (>=90% coverage); docs: comprehensive English JavaDoc
1 parent 8152c4e commit 3031ef1

28 files changed

Lines changed: 2910 additions & 483 deletions

src/main/java/org/springframework/bytebuddy/annotation/WebBound.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,41 @@
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
2424

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+
*/
2540
@Target({ ElementType.TYPE, ElementType.METHOD })
2641
@Retention(RetentionPolicy.RUNTIME)
2742
@Documented
2843
@Inherited
2944
public @interface WebBound {
3045

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+
*/
3152
String uid() default "";
3253

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+
*/
3360
String json() default "{}";
3461

3562
}
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
package org.springframework.bytebuddy.bytecode;
22

3+
/**
4+
* Abstract base class for dynamically generated Spring MVC endpoint classes.
5+
* This class serves as the superclass for all classes generated by
6+
* {@link EndpointApiBuilder} or {@link ReactiveHandlerBuilder} using
7+
* the ByteBuddy code generation library.
8+
*
9+
* <p>Instances of subclasses of this type are created at runtime and
10+
* represent dynamically constructed controller endpoints that can be
11+
* registered within a Spring application context.</p>
12+
*
13+
* @author [@Loong Wan](https://github.com/loong10k)
14+
* @since 3.0.0
15+
* @see EndpointApiBuilder
16+
* @see ReactiveHandlerBuilder
17+
*/
318
public abstract class EndpointApi {
4-
5-
}
19+
20+
}

0 commit comments

Comments
 (0)