Skip to content

Commit 3459014

Browse files
committed
fix(comment): Error generating Java docs
1 parent c873a36 commit 3459014

File tree

11 files changed

+141
-39
lines changed

11 files changed

+141
-39
lines changed

src/main/java/com/github/codeboyzhou/mcp/declarative/McpServers.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
/**
2222
* This class is a singleton that provides methods to start MCP servers.
2323
*
24-
* @apiNote Example usage:
25-
* <pre>{@code
24+
* <p>Example usage:
25+
*
26+
* <pre>{@code
2627
* McpServerInfo serverInfo = McpServerInfo.builder().build();
2728
* McpServers.run(MyApplication.class, args).startStdioServer(serverInfo);
2829
*

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpI18nEnabled.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
*
1616
* <p>Note: This annotation is only applicable to the main class of the MCP server application.
1717
*
18-
* @apiNote Example usage:
19-
* <pre>{@code
18+
* <p>Example usage:
19+
*
20+
* <pre>{@code
2021
* @McpI18nEnabled
2122
* public class MyMcpServerApplication {
2223
* // Application logic...

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpJsonSchemaDefinitionProperty.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,26 @@
2020
@Target(ElementType.FIELD)
2121
@Retention(RetentionPolicy.RUNTIME)
2222
public @interface McpJsonSchemaDefinitionProperty {
23-
24-
/** The name of the JSON schema property. If not specified, the field name will be used. */
23+
/**
24+
* The name of the JSON schema property. If not specified, the field name will be used.
25+
*
26+
* @return the name of the JSON schema property
27+
*/
2528
String name() default StringHelper.EMPTY;
2629

2730
/**
2831
* The description of the JSON schema property. If not specified, the default value {@code "Not
2932
* specified"} will be used.
33+
*
34+
* @return the description of the JSON schema property
3035
*/
3136
String description() default StringHelper.EMPTY;
3237

3338
/**
3439
* Whether the JSON schema property is required. If not specified, the default value {@code false}
3540
* will be used.
41+
*
42+
* @return whether the JSON schema property is required
3643
*/
3744
boolean required() default false;
3845
}

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpPrompt.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
* and description can be specified via the corresponding attributes. If omitted, these metadata
1414
* fields will default to the literal string "Not specified".
1515
*
16-
* @apiNote Example usage:
17-
* <pre>{@code
16+
* <p>Example usage:
17+
*
18+
* <pre>{@code
1819
* @McpPrompt
1920
* public String getWeather(String city) {
2021
* // Method implementation...
@@ -29,12 +30,24 @@
2930
@Target(ElementType.METHOD)
3031
@Retention(RetentionPolicy.RUNTIME)
3132
public @interface McpPrompt {
32-
/** The name of the prompt. Defaults to the name of the annotated method. */
33+
/**
34+
* The name of the prompt. Defaults to the name of the annotated method.
35+
*
36+
* @return the name of the prompt
37+
*/
3338
String name() default StringHelper.EMPTY;
3439

35-
/** The title of the prompt. Defaults to the literal string "Not specified". */
40+
/**
41+
* The title of the prompt. Defaults to the literal string "Not specified".
42+
*
43+
* @return the title of the prompt
44+
*/
3645
String title() default StringHelper.EMPTY;
3746

38-
/** The description of the prompt. Defaults to the literal string "Not specified". */
47+
/**
48+
* The description of the prompt. Defaults to the literal string "Not specified".
49+
*
50+
* @return the description of the prompt
51+
*/
3952
String description() default StringHelper.EMPTY;
4053
}

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpPromptParam.java

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* description, and required can be specified via the corresponding attributes. If omitted, these
1515
* metadata fields will default to the literal string "Not specified" and {@code false}.
1616
*
17-
* @apiNote Example usage:
18-
* <pre>{@code
17+
* <p>Example usage:
18+
*
19+
* <pre>{@code
1920
* @McpPrompt
2021
* public String getWeather(@McpPromptParam(name = "city") String city) {
2122
* // Method implementation...
@@ -30,15 +31,31 @@
3031
@Target(ElementType.PARAMETER)
3132
@Retention(RetentionPolicy.RUNTIME)
3233
public @interface McpPromptParam {
33-
/** The name of the prompt parameter. */
34+
/**
35+
* The name of the prompt parameter.
36+
*
37+
* @return the name of the prompt parameter
38+
*/
3439
String name();
3540

36-
/** The title of the prompt parameter. Defaults to the literal string "Not specified". */
41+
/**
42+
* The title of the prompt parameter. Defaults to the literal string "Not specified".
43+
*
44+
* @return the title of the prompt parameter
45+
*/
3746
String title() default StringHelper.EMPTY;
3847

39-
/** The description of the prompt parameter. Defaults to the literal string "Not specified". */
48+
/**
49+
* The description of the prompt parameter. Defaults to the literal string "Not specified".
50+
*
51+
* @return the description of the prompt parameter
52+
*/
4053
String description() default StringHelper.EMPTY;
4154

42-
/** Whether the prompt parameter is required. Defaults to {@code false}. */
55+
/**
56+
* Whether the prompt parameter is required. Defaults to {@code false}.
57+
*
58+
* @return whether the prompt parameter is required
59+
*/
4360
boolean required() default false;
4461
}

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpResource.java

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* description, and MIME type can be specified via the corresponding attributes. If omitted, these
1515
* metadata fields will default to the literal string "Not specified" and "text/plain".
1616
*
17-
* @apiNote Example usage:
18-
* <pre>{@code
17+
* <p>Example usage:
18+
*
19+
* <pre>{@code
1920
* @McpResource(uri = "weather://forecast/{city}/{date}")
2021
* public String getWeather() {
2122
* // Method implementation...
@@ -30,27 +31,53 @@
3031
@Target(ElementType.METHOD)
3132
@Retention(RetentionPolicy.RUNTIME)
3233
public @interface McpResource {
33-
/** The URI of the resource. */
34+
/**
35+
* The URI of the resource.
36+
*
37+
* @return the URI of the resource
38+
*/
3439
String uri();
3540

36-
/** The name of the resource. Defaults to the name of the annotated method. */
41+
/**
42+
* The name of the resource. Defaults to the name of the annotated method.
43+
*
44+
* @return the name of the resource
45+
*/
3746
String name() default StringHelper.EMPTY;
3847

39-
/** The title of the resource. Defaults to the literal string "Not specified". */
48+
/**
49+
* The title of the resource. Defaults to the literal string "Not specified".
50+
*
51+
* @return the title of the resource
52+
*/
4053
String title() default StringHelper.EMPTY;
4154

42-
/** The description of the resource. Defaults to the literal string "Not specified". */
55+
/**
56+
* The description of the resource. Defaults to the literal string "Not specified".
57+
*
58+
* @return the description of the resource
59+
*/
4360
String description() default StringHelper.EMPTY;
4461

45-
/** The MIME type of the resource. Defaults to "text/plain". */
62+
/**
63+
* The MIME type of the resource. Defaults to "text/plain".
64+
*
65+
* @return the MIME type of the resource
66+
*/
4667
String mimeType() default "text/plain";
4768

4869
/**
4970
* The roles required to access the resource. Defaults to {@link McpSchema.Role#ASSISTANT} and
5071
* {@link McpSchema.Role#USER}.
72+
*
73+
* @return the roles required to access the resource
5174
*/
5275
McpSchema.Role[] roles() default {McpSchema.Role.ASSISTANT, McpSchema.Role.USER};
5376

54-
/** The priority of the resource. Defaults to 1.0. */
77+
/**
78+
* The priority of the resource. Defaults to 1.0.
79+
*
80+
* @return the priority of the resource
81+
*/
5582
double priority() default 1.0;
5683
}

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpServerApplication.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
* <p>The base package for component scanning can be specified via the {@code basePackage}
1313
* attribute. If not specified, the package of the annotated class will be used.
1414
*
15-
* @apiNote Example usage:
16-
* <pre>{@code
15+
* <p>Example usage:
16+
*
17+
* <pre>{@code
1718
* @McpServerApplication(basePackage = "com.example.mcp")
1819
* public class MyMcpServerApplication {
1920
* // Application logic...
@@ -27,14 +28,20 @@
2728
@Target(ElementType.TYPE)
2829
@Retention(RetentionPolicy.RUNTIME)
2930
public @interface McpServerApplication {
30-
/** The base package for component scanning. Defaults to the package of the annotated class. */
31+
/**
32+
* The base package for component scanning. Defaults to the package of the annotated class.
33+
*
34+
* @return the base package for component scanning
35+
*/
3136
String basePackage() default StringHelper.EMPTY;
3237

3338
/**
34-
* The base package class for component scanning. Defaults to {@link Object.class}.
39+
* The base package class for component scanning. Defaults to {@code Object.class}.
3540
*
3641
* <p>Note: This attribute is intended to be used when the base package cannot be determined
3742
* statically. In most cases, {@link #basePackage()} should be used instead.
43+
*
44+
* @return the base package class for component scanning
3845
*/
3946
Class<?> basePackageClass() default Object.class;
4047
}

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpTool.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
* description can be specified via the corresponding attributes. If omitted, these metadata fields
1414
* will default to the literal string "Not specified".
1515
*
16-
* @apiNote Example usage:
17-
* <pre>{@code
16+
* <p>Example usage:
17+
*
18+
* <pre>{@code
1819
* @McpTool
1920
* public String getWeather(String city) {
2021
* // Method implementation...
@@ -29,12 +30,24 @@
2930
@Target(ElementType.METHOD)
3031
@Retention(RetentionPolicy.RUNTIME)
3132
public @interface McpTool {
32-
/** The name of the tool. Defaults to the name of the annotated method. */
33+
/**
34+
* The name of the tool. Defaults to the name of the annotated method.
35+
*
36+
* @return the name of the tool
37+
*/
3338
String name() default StringHelper.EMPTY;
3439

35-
/** The title of the tool. Defaults to the literal string "Not specified". */
40+
/**
41+
* The title of the tool. Defaults to the literal string "Not specified".
42+
*
43+
* @return the title of the tool
44+
*/
3645
String title() default StringHelper.EMPTY;
3746

38-
/** The description of the tool. Defaults to the literal string "Not specified". */
47+
/**
48+
* The description of the tool. Defaults to the literal string "Not specified".
49+
*
50+
* @return the description of the tool
51+
*/
3952
String description() default StringHelper.EMPTY;
4053
}

src/main/java/com/github/codeboyzhou/mcp/declarative/annotation/McpToolParam.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* required status can be specified via the corresponding attributes. If omitted, these metadata
1515
* fields will default to the literal string "Not specified" and {@code false}.
1616
*
17-
* @apiNote Example usage:
18-
* <pre>{@code
17+
* <p>Example usage:
18+
*
19+
* <pre>{@code
1920
* @McpTool
2021
* public String getWeather(@McpToolParam(name = "city") String city) {
2122
* // Method implementation...
@@ -27,12 +28,24 @@
2728
@Target(ElementType.PARAMETER)
2829
@Retention(RetentionPolicy.RUNTIME)
2930
public @interface McpToolParam {
30-
/** The name of the tool parameter. */
31+
/**
32+
* The name of the tool parameter.
33+
*
34+
* @return the name of the tool parameter
35+
*/
3136
String name();
3237

33-
/** The description of the tool parameter. Defaults to the literal string "Not specified". */
38+
/**
39+
* The description of the tool parameter. Defaults to the literal string "Not specified".
40+
*
41+
* @return the description of the tool parameter
42+
*/
3443
String description() default StringHelper.EMPTY;
3544

36-
/** Whether the tool parameter is required. Defaults to {@code false}. */
45+
/**
46+
* Whether the tool parameter is required. Defaults to {@code false}.
47+
*
48+
* @return whether the tool parameter is required
49+
*/
3750
boolean required() default false;
3851
}

src/main/java/com/github/codeboyzhou/mcp/declarative/common/Immutable.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public record Immutable<T>(T value) {
1313
* Creates a new instance of {@code Immutable} with the specified value.
1414
*
1515
* @param value the value to be wrapped
16+
* @param <T> the type of the value
1617
* @return a new instance of {@code Immutable} with the specified value
1718
*/
1819
public static <T> Immutable<T> of(T value) {

0 commit comments

Comments
 (0)