当前位置: 首页>>代码示例>>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;未经允许,请勿转载。