當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。