Add comprehensive Javadoc documentation to server components, including annotations, request/response handling, routing, and WebSocket support.
This commit is contained in:
@@ -3,10 +3,28 @@ package dev.coph.nextusweb.server.json;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
|
||||
/**
|
||||
* Holder for the application-wide Jackson {@link ObjectMapper}.
|
||||
*
|
||||
* <p>A single, pre-configured mapper instance is shared across the whole server because
|
||||
* {@code ObjectMapper} is thread-safe once configured and is relatively expensive to build.
|
||||
* Centralizing it here ensures every component (request parsing, response serialization,
|
||||
* WebSocket payloads) uses identical serialization settings.</p>
|
||||
*
|
||||
* <p>This class is a static holder and cannot be instantiated.</p>
|
||||
*/
|
||||
public final class JsonMapper {
|
||||
|
||||
/**
|
||||
* The shared, thread-safe Jackson mapper used throughout the server for all JSON reading
|
||||
* and writing.
|
||||
*/
|
||||
public static final ObjectMapper MAPPER = tools.jackson.databind.json.JsonMapper.builder()
|
||||
// .addModule(new JavaTimeModule())
|
||||
.build();
|
||||
|
||||
|
||||
/**
|
||||
* Private constructor preventing instantiation of this static holder class.
|
||||
*/
|
||||
private JsonMapper() {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user