File tree Expand file tree Collapse file tree 4 files changed +42
-42
lines changed
mcp-json-jackson/src/main/java/io/modelcontextprotocol/json
mcp-json/src/main/java/io/modelcontextprotocol/json Expand file tree Collapse file tree 4 files changed +42
-42
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,24 @@ public final class JacksonMcpJsonMapper implements McpJsonMapper {
15
15
16
16
private final ObjectMapper objectMapper ;
17
17
18
- /**
19
- * Constructs a new JacksonMcpJsonMapper instance with the given ObjectMapper.
20
- *
21
- * @param objectMapper the ObjectMapper to be used for JSON serialization and deserialization.
22
- * Must not be null.
23
- * @throws IllegalArgumentException if the provided ObjectMapper is null.
24
- */
18
+ /**
19
+ * Constructs a new JacksonMcpJsonMapper instance with the given ObjectMapper.
20
+ * @param objectMapper the ObjectMapper to be used for JSON serialization and
21
+ * deserialization. Must not be null.
22
+ * @throws IllegalArgumentException if the provided ObjectMapper is null.
23
+ */
25
24
public JacksonMcpJsonMapper (ObjectMapper objectMapper ) {
26
25
if (objectMapper == null ) {
27
26
throw new IllegalArgumentException ("ObjectMapper must not be null" );
28
27
}
29
28
this .objectMapper = objectMapper ;
30
29
}
31
30
32
- /**
33
- * Returns the underlying Jackson {@link ObjectMapper} used for JSON serialization and deserialization.
34
- *
35
- * @return the ObjectMapper instance
36
- */
31
+ /**
32
+ * Returns the underlying Jackson {@link ObjectMapper} used for JSON serialization and
33
+ * deserialization.
34
+ * @return the ObjectMapper instance
35
+ */
37
36
public ObjectMapper getObjectMapper () {
38
37
return objectMapper ;
39
38
}
Original file line number Diff line number Diff line change 4
4
import io .modelcontextprotocol .json .McpJsonMapperSupplier ;
5
5
6
6
/**
7
- * A supplier of {@link McpJsonMapper} instances that uses the Jackson library for JSON serialization and deserialization.
7
+ * A supplier of {@link McpJsonMapper} instances that uses the Jackson library for JSON
8
+ * serialization and deserialization.
8
9
* <p>
9
- * This implementation provides a {@link McpJsonMapper} backed by a Jackson {@link com.fasterxml.jackson.databind.ObjectMapper}.
10
+ * This implementation provides a {@link McpJsonMapper} backed by a Jackson
11
+ * {@link com.fasterxml.jackson.databind.ObjectMapper}.
10
12
*/
11
13
public class JacksonMcpJsonMapperSupplier implements McpJsonMapperSupplier {
12
14
13
- /**
14
- * Returns a new instance of {@link McpJsonMapper} that uses the Jackson library for JSON serialization and deserialization.
15
- * <p>
16
- * The returned {@link McpJsonMapper} is backed by a new instance of {@link com.fasterxml.jackson.databind.ObjectMapper}.
17
- *
18
- * @return a new {@link McpJsonMapper} instance
19
- */
15
+ /**
16
+ * Returns a new instance of {@link McpJsonMapper} that uses the Jackson library for
17
+ * JSON serialization and deserialization.
18
+ * <p>
19
+ * The returned {@link McpJsonMapper} is backed by a new instance of
20
+ * {@link com.fasterxml.jackson.databind.ObjectMapper}.
21
+ * @return a new {@link McpJsonMapper} instance
22
+ */
20
23
@ Override
21
24
public McpJsonMapper get () {
22
25
return new JacksonMcpJsonMapper (new com .fasterxml .jackson .databind .ObjectMapper ());
Original file line number Diff line number Diff line change 12
12
*/
13
13
public class JacksonJsonSchemaValidatorSupplier implements JsonSchemaValidatorSupplier {
14
14
15
- /**
16
- * Returns a new instance of {@link JsonSchemaValidator} that uses the Jackson library
17
- * for JSON schema validation.
18
- *
19
- * @return A {@link JsonSchemaValidator} instance.
20
- */
15
+ /**
16
+ * Returns a new instance of {@link JsonSchemaValidator} that uses the Jackson library
17
+ * for JSON schema validation.
18
+ * @return A {@link JsonSchemaValidator} instance.
19
+ */
21
20
@ Override
22
21
public JsonSchemaValidator get () {
23
22
return new DefaultJsonSchemaValidator ();
Original file line number Diff line number Diff line change @@ -11,16 +11,15 @@ public abstract class TypeRef<T> {
11
11
12
12
private final Type type ;
13
13
14
- /**
15
- * Constructs a new TypeRef instance, capturing the generic type information
16
- * of the subclass. This constructor should be called from an anonymous subclass
17
- * to capture the actual type arguments. For example:
18
- * <pre>
19
- * TypeRef<List<Foo>> ref = new TypeRef<>(){};
20
- * </pre>
21
- *
22
- * @throws IllegalStateException if TypeRef is not subclassed with actual type information
23
- */
14
+ /**
15
+ * Constructs a new TypeRef instance, capturing the generic type information of the
16
+ * subclass. This constructor should be called from an anonymous subclass to capture
17
+ * the actual type arguments. For example: <pre>
18
+ * TypeRef<List<Foo>> ref = new TypeRef<>(){};
19
+ * </pre>
20
+ * @throws IllegalStateException if TypeRef is not subclassed with actual type
21
+ * information
22
+ */
24
23
protected TypeRef () {
25
24
Type superClass = getClass ().getGenericSuperclass ();
26
25
if (superClass instanceof Class ) {
@@ -29,11 +28,11 @@ protected TypeRef() {
29
28
this .type = ((ParameterizedType ) superClass ).getActualTypeArguments ()[0 ];
30
29
}
31
30
32
- /**
33
- * Returns the captured type information.
34
- *
35
- * @return the Type representing the actual type argument captured by this TypeRef instance
36
- */
31
+ /**
32
+ * Returns the captured type information.
33
+ * @return the Type representing the actual type argument captured by this TypeRef
34
+ * instance
35
+ */
37
36
public Type getType () {
38
37
return type ;
39
38
}
You can’t perform that action at this time.
0 commit comments