本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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