All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onetwo.common.spring.converter.StringToJackson2ObjectNodeConverterFactory Maven / Gradle / Ivy

package org.onetwo.common.spring.converter;

import org.onetwo.common.jackson.JsonMapper;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;

import com.fasterxml.jackson.databind.node.ObjectNode;

/**
 * @author weishao zeng
 * @deprecated instead of StringToJackson2JsonNodeConverterFactory
 * 
*/ @Deprecated public class StringToJackson2ObjectNodeConverterFactory implements ConverterFactory { @Override public Converter getConverter(Class targetType) { return new StringToObjectNode<>(targetType); } private class StringToObjectNode implements Converter { private JsonMapper jsonMapper = JsonMapper.IGNORE_NULL; private Class targetType; public StringToObjectNode(Class targetType) { this.targetType = targetType; } @Override public T convert(String source) { T node = jsonMapper.fromJson(source, targetType); return node; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy