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

org.springframework.social.partnercenter.serialization.Json Maven / Gradle / Ivy

package org.springframework.social.partnercenter.serialization;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;

public class Json {
	private static JsonConverter jsonConverter;

	static {
		jsonConverter = new JsonConverter();
	}

	public static JsonConverter instance(){
		return new JsonConverter();
	}

	public static JsonConverter instance(JsonSerializationSettings serializationSettings){
		return new JsonConverter(serializationSettings);
	}

	public static  T fromJson(String jsonString, Class targetClass){
		return jsonConverter.fromJson(jsonString, targetClass);
	}

	public static  T fromJson(String jsonString, TypeReference targetClass){
		return jsonConverter.fromJson(jsonString, targetClass);
	}

	public static  T fromJson(String jsonString, Class targetClass, JsonSerializationSettings serializationSettings){
		return jsonConverter.fromJson(jsonString, targetClass, serializationSettings);
	}

	public static  String toJson(T objectToSerialize){
		return jsonConverter.toJson(objectToSerialize);
	}

	public static  String toJson(T objectToSerialize, JsonSerializationSettings serializationSettings){
		return jsonConverter.toJson(objectToSerialize, serializationSettings);
	}

	public static void configure(JsonSerializationSettings serializationSettings) {
		jsonConverter.configure(serializationSettings);
	}

	public static JsonNode toJsonNode(String json){
		return jsonConverter.toJsonNode(json);
	}

	public static JsonNode toJsonNode(Object json){
		return jsonConverter.toJsonNode(json);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy