private MapperBuilder<?, ?> determineMapperInstance() {
        if (jsonFactory instanceof final YAMLFactory factory) {
            return YAMLMapper.builder(factory);
        }
        if (jsonFactory instanceof final XmlFactory factory) {
            return XmlMapper.builder(factory);
        }
        return JsonMapper.builder(jsonFactory);
    }
Initialize.

@param mapper the mapper
@return the object mapper
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/JacksonObjectMapperFactory.java