Skip to content

Commit 5161699

Browse files
committed
Polish McpJsonDefaults Javadoc
1 parent 09b1b01 commit 5161699

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

mcp-core/src/main/java/io/modelcontextprotocol/json/McpJsonDefaults.java

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@
88
import io.modelcontextprotocol.util.McpServiceLoader;
99

1010
/**
11-
* This class is to be used to provide access to the default McpJsonMapper and to the
12-
* default JsonSchemaValidator instances via the static methods: getMapper and
13-
* getSchemaValidator.
11+
* This class is to be used to provide access to the default {@link McpJsonMapper} and to
12+
* the default {@link JsonSchemaValidator} instances via the static methods:
13+
* {@link #getMapper()} and {@link #getSchemaValidator()}.
1414
* <p>
1515
* The initialization of (singleton) instances of this class is different in non-OSGi
16-
* environments and OSGi environments. Specifically, in non-OSGi environments The
17-
* McpJsonDefaults class will be loaded by whatever classloader is used to call one of the
18-
* existing static get methods for the first time. For servers, this will usually be in
19-
* response to the creation of the first McpServer instance. At that first time, the
20-
* mcpMapperServiceLoader and mcpValidatorServiceLoader will be null, and the
21-
* McpJsonDefaults constructor will be called, creating/initializing the
22-
* mcpMapperServiceLoader and the mcpValidatorServiceLoader...which will then be used to
23-
* call the ServiceLoader.load method.
16+
* environments and OSGi environments. Specifically, in non-OSGi environments the
17+
* {@code McpJsonDefaults} class will be loaded by whatever classloader is used to call
18+
* one of the existing static get methods for the first time. For servers, this will
19+
* usually be in response to the creation of the first {@code McpServer} instance. At that
20+
* first time, the {@code mcpMapperServiceLoader} and {@code mcpValidatorServiceLoader}
21+
* will be null, and the {@code McpJsonDefaults} constructor will be called,
22+
* creating/initializing the {@code mcpMapperServiceLoader} and the
23+
* {@code mcpValidatorServiceLoader}...which will then be used to call the
24+
* {@code ServiceLoader.load} method.
2425
* <p>
2526
* In OSGi environments, upon bundle activation SCR will create a new (singleton) instance
26-
* of McpJsonDefaults (via the constructor), and then inject suppliers via the
27-
* setMcpJsonMapperSupplier and setJsonSchemaValidatorSupplier methods with the
28-
* SCR-discovered instances of those services. This does depend upon the jars/bundles
29-
* providing those suppliers to be started/activated. This SCR behavior is dictated by xml
30-
* files in OSGi-INF directory of mcp-core (this project/jar/bundle), and the jsonmapper
31-
* and jsonschemvalidator provider jars/bundles (e.g. mcp-json-jackson2, 3, or others).
27+
* of {@code McpJsonDefaults} (via the constructor), and then inject suppliers via the
28+
* {@code setMcpJsonMapperSupplier} and {@code setJsonSchemaValidatorSupplier} methods
29+
* with the SCR-discovered instances of those services. This does depend upon the
30+
* jars/bundles providing those suppliers to be started/activated. This SCR behavior is
31+
* dictated by xml files in {@code OSGi-INF} directory of {@code mcp-core} (this
32+
* project/jar/bundle), and the jsonmapper and jsonschemavalidator provider jars/bundles
33+
* (e.g. {@code mcp-json-jackson2}, {@code mcp-json-jackson3}, or others).
3234
*/
3335
public class McpJsonDefaults {
3436

0 commit comments

Comments
 (0)