forked from modelcontextprotocol/java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJacksonMcpJsonMapperSupplier.java
More file actions
28 lines (24 loc) · 966 Bytes
/
Copy pathJacksonMcpJsonMapperSupplier.java
File metadata and controls
28 lines (24 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package io.modelcontextprotocol.json.jackson;
import io.modelcontextprotocol.json.McpJsonMapper;
import io.modelcontextprotocol.json.McpJsonMapperSupplier;
/**
* A supplier of {@link McpJsonMapper} instances that uses the Jackson library for JSON
* serialization and deserialization.
* <p>
* This implementation provides a {@link McpJsonMapper} backed by a Jackson
* {@link com.fasterxml.jackson.databind.ObjectMapper}.
*/
public class JacksonMcpJsonMapperSupplier implements McpJsonMapperSupplier {
/**
* Returns a new instance of {@link McpJsonMapper} that uses the Jackson library for
* JSON serialization and deserialization.
* <p>
* The returned {@link McpJsonMapper} is backed by a new instance of
* {@link com.fasterxml.jackson.databind.ObjectMapper}.
* @return a new {@link McpJsonMapper} instance
*/
@Override
public McpJsonMapper get() {
return new JacksonMcpJsonMapper(new com.fasterxml.jackson.databind.ObjectMapper());
}
}