当前位置: 首页>>代码示例>>Java>>正文


Java JsonEncoding.values方法代码示例

本文整理汇总了Java中com.fasterxml.jackson.core.JsonEncoding.values方法的典型用法代码示例。如果您正苦于以下问题:Java JsonEncoding.values方法的具体用法?Java JsonEncoding.values怎么用?Java JsonEncoding.values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.fasterxml.jackson.core.JsonEncoding的用法示例。


在下文中一共展示了JsonEncoding.values方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getJsonEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
/**
 * Determine the JSON encoding to use for the given content type.
 * @param contentType the media type as requested by the caller
 * @return the JSON encoding to use (never {@code null})
 */
protected JsonEncoding getJsonEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharSet() != null) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:JetBrains,项目名称:teamcity-hashicorp-vault-plugin,代码行数:17,代码来源:AbstractJackson2HttpMessageConverter.java

示例2: getJsonEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
/**
 * Determine the JSON encoding to use for the given content type.
 * @param contentType the MIME type from the MessageHeaders, if any
 * @return the JSON encoding to use (never {@code null})
 */
protected JsonEncoding getJsonEncoding(MimeType contentType) {
	if ((contentType != null) && (contentType.getCharSet() != null)) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:17,代码来源:MappingJackson2MessageConverter.java

示例3: getJsonEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
/**
 * Determine the JSON encoding to use for the given content type.
 * @param contentType the media type as requested by the caller
 * @return the JSON encoding to use (never <code>null</code>)
 */
protected JsonEncoding getJsonEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharSet() != null) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:bestarandyan,项目名称:ShoppingMall,代码行数:17,代码来源:MappingJackson2HttpMessageConverter.java

示例4: getJsonEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
/**
 * Determine the JSON encoding to use for the given content type.
 *
 * @param contentType
 *         the media type as requested by the caller
 * @return the JSON encoding to use (never {@code null})
 */
protected JsonEncoding getJsonEncoding(MediaType contentType) {
    if (contentType != null && contentType.getCharSet() != null) {
        Charset charset = contentType.getCharSet();
        for (JsonEncoding encoding : JsonEncoding.values()) {
            if (charset.name()
                    .equals(encoding.getJavaName())) {
                return encoding;
            }
        }
    }
    return JsonEncoding.UTF8;
}
 
开发者ID:dschulten,项目名称:hydra-java,代码行数:20,代码来源:SirenMessageConverter.java

示例5: getJsonEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
/**
 * <br>
 * 2013-10-25 下午12:29:58
 *
 * @param characterEncoding
 * @return
 */
private JsonEncoding getJsonEncoding(String characterEncoding) {
    for (JsonEncoding encoding : JsonEncoding.values()) {
        if (characterEncoding.equals(encoding.getJavaName())) {
            return encoding;
        }
    }
    return JsonEncoding.UTF8;
}
 
开发者ID:blademainer,项目名称:common_utils,代码行数:16,代码来源:JavassistFilterPropertyHandler.java

示例6: getJsonEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
/**
 * Determine the JSON encoding to use for the given content type.
 *
 * @param contentType the media type as requested by the caller
 * @return the JSON encoding to use (never <code>null</code>)
 */
private JsonEncoding getJsonEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharset() != null) {
		Charset charset = contentType.getCharset();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:briandilley,项目名称:jsonrpc4j,代码行数:18,代码来源:MappingJacksonRPC2HttpMessageConverter.java

示例7: getEncoding

import com.fasterxml.jackson.core.JsonEncoding; //导入方法依赖的package包/类
private JsonEncoding getEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharSet() != null) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:concentricsky,项目名称:android-viewer-for-khan-academy,代码行数:12,代码来源:MappingJacksonHttpMessageConverter.java


注:本文中的com.fasterxml.jackson.core.JsonEncoding.values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。