當前位置: 首頁>>代碼示例>>Java>>正文


Java GsonBuilder.disableHtmlEscaping方法代碼示例

本文整理匯總了Java中com.google.gson.GsonBuilder.disableHtmlEscaping方法的典型用法代碼示例。如果您正苦於以下問題:Java GsonBuilder.disableHtmlEscaping方法的具體用法?Java GsonBuilder.disableHtmlEscaping怎麽用?Java GsonBuilder.disableHtmlEscaping使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gson.GsonBuilder的用法示例。


在下文中一共展示了GsonBuilder.disableHtmlEscaping方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unpack

import com.google.gson.GsonBuilder; //導入方法依賴的package包/類
public void unpack(@NonNull final JSONObject payload) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "unpacking");
    }

    final GsonBuilder builder = new GsonBuilder();
    builder.disableHtmlEscaping();
    builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);

    final Gson gson = builder.create();
    nluNuance = gson.fromJson(payload.toString(), new TypeToken<NLUNuance>() {
    }.getType());

    new NLUCoerce(getNLUNuance(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(),
            getConfidenceArray(), getResultsArray()).coerce();
}
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:17,代碼來源:ResolveNuance.java

示例2: unpack

import com.google.gson.GsonBuilder; //導入方法依賴的package包/類
public void unpack(@NonNull final JSONObject payload) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "unpacking");
    }

    final GsonBuilder builder = new GsonBuilder();
    builder.disableHtmlEscaping();
    builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);

    final Gson gson = builder.create();
    nluSaiy = gson.fromJson(payload.toString(), new TypeToken<NLUSaiy>() {
    }.getType());

    new NLUCoerce(getNLUSaiy(), getContext(), getSupportedLanguage(), getVRLocale(), getTTSLocale(),
            getConfidenceArray(), getResultsArray()).coerce();
}
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:17,代碼來源:ResolveSaiy.java

示例3: serialize

import com.google.gson.GsonBuilder; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public String serialize() {
    final GsonBuilder builder = new GsonBuilder();
    builder.excludeFieldsWithoutExposeAnnotation();
    builder.disableHtmlEscaping();
    final Gson gson = builder.create();
    return gson.toJson(this);
}
 
開發者ID:NoraUi,項目名稱:NoraUi,代碼行數:12,代碼來源:DemoModel.java

示例4: json

import com.google.gson.GsonBuilder; //導入方法依賴的package包/類
private String json()
{
    GsonBuilder builder = new GsonBuilder();
    builder.setPrettyPrinting();
    builder.disableHtmlEscaping();
    Gson gson = builder.create();

    return gson.toJson(this);
}
 
開發者ID:mauriciotogneri,項目名稱:stewie,代碼行數:10,代碼來源:Swagger.java

示例5: create

import com.google.gson.GsonBuilder; //導入方法依賴的package包/類
public static final Gson create(boolean pretty) {
	GsonBuilder builder = new GsonBuilder();
	builder.serializeNulls();
	builder.disableHtmlEscaping();

	// Install MongoDB / BSON serializers
	tryToAddSerializers("io.datatree.dom.adapters.JsonGsonBsonSerializers", builder);

	// Install serializers for Apache Cassandra
	addSerializer(builder, InetAddress.class, (value) -> {
		return new JsonPrimitive(value.getCanonicalHostName());
	});
	addSerializer(builder, Inet4Address.class, (value) -> {
		return new JsonPrimitive(value.getCanonicalHostName());
	});
	addSerializer(builder, Inet6Address.class, (value) -> {
		return new JsonPrimitive(value.getCanonicalHostName());
	});

	// Date serializer
	if (Config.USE_TIMESTAMPS) {
		builder.setDateFormat(Config.TIMESTAMP_FORMAT);
	} else {

		// Milliseconds since epoch Jan 1 , 1970 00:00:00 UTC
		addSerializer(builder, Date.class, (value) -> {
			return new JsonPrimitive(value.getTime());
		});
	}

	// BASE64 serializer
	addSerializer(builder, byte[].class, (value) -> {
		return new JsonPrimitive(BASE64.encode(value));
	});

	// Pretty printing
	if (pretty) {
		builder.setPrettyPrinting();
	}
	return builder.create();
}
 
開發者ID:berkesa,項目名稱:datatree-adapters,代碼行數:42,代碼來源:JsonGson.java

示例6: getGson

import com.google.gson.GsonBuilder; //導入方法依賴的package包/類
public static Gson getGson() {
    GsonBuilder builder = new GsonBuilder();
    builder.disableHtmlEscaping();
    return builder.create();
}
 
開發者ID:politedog,項目名稱:mock-interceptor,代碼行數:6,代碼來源:GsonUtil.java


注:本文中的com.google.gson.GsonBuilder.disableHtmlEscaping方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。