• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AsPropertyTypeDeserializer类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer的典型用法代码示例。如果您正苦于以下问题:Java AsPropertyTypeDeserializer类的具体用法?Java AsPropertyTypeDeserializer怎么用?Java AsPropertyTypeDeserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AsPropertyTypeDeserializer类属于com.fasterxml.jackson.databind.jsontype.impl包,在下文中一共展示了AsPropertyTypeDeserializer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: InternalTypeDeserializer

点赞 2

import com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer; //导入依赖的package包/类
public InternalTypeDeserializer(Class<T> baseClass, TypeIdResolver typeIdResolver)
{
    super(baseClass);
    this.typeDeserializer = new AsPropertyTypeDeserializer(SimpleType.construct(baseClass), typeIdResolver, TYPE_PROPERTY, false, null);
}
 

开发者ID:y-lan,
项目名称:presto,
代码行数:6,
代码来源:AbstractTypedJacksonModule.java

示例2: WideningAsPropertyTypeDeserializer

点赞 2

import com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer; //导入依赖的package包/类
public WideningAsPropertyTypeDeserializer(AsPropertyTypeDeserializer src, BeanProperty property) {
    super(src, property);
}
 

开发者ID:CIDARLAB,
项目名称:clotho3crud,
代码行数:4,
代码来源:WideningAsPropertyTypeDeserializer.java

示例3: deserializeWithType

点赞 2

import com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public DynamicBean deserializeWithType(JsonParser jp,
		DeserializationContext ctxt, TypeDeserializer typeDeserializer)
		throws IOException, JsonProcessingException
{
	ObjectMapper tMapper = (ObjectMapper) jp.getCodec();
	JsonNode tJsonRootNode = tMapper.readTree(jp);
	ObjectNode tRootNode = null;

	if (tJsonRootNode.isObject())
	{
		tRootNode = (ObjectNode) tJsonRootNode;
	} else
	{
		tRootNode = tMapper.createObjectNode();
		tRootNode.put("value", tJsonRootNode);
	}

	JsonNode tDynamicBeanClassNameNode = tRootNode.get(typeDeserializer
			.getPropertyName());

	String tDynamicBeanClassName = ((AsPropertyTypeDeserializer) typeDeserializer)
			.baseTypeName();
	if (tDynamicBeanClassNameNode != null)
	{
		tDynamicBeanClassName = tRootNode.get(
				typeDeserializer.getPropertyName()).asText();
	}

	try
	{
		ClassLoader tCurrentThreadLoader = Thread.currentThread()
				.getContextClassLoader();

		@SuppressWarnings("unchecked")
		Class<? extends DynamicBean> tDynamicBeanClass = (Class<? extends DynamicBean>) Class
				.forName(tDynamicBeanClassName, true, tCurrentThreadLoader);

		DynamicBean tDeserializerDynamicBean = DynamicBeanFactory
				.parseJSONNode(tRootNode, tDynamicBeanClass);

		// clean up the @class field
		tDeserializerDynamicBean.deleteField(DealField
				.useCustomField(typeDeserializer.getPropertyName()));

		return tDeserializerDynamicBean;
	} catch (ClassNotFoundException ex)
	{
		LOG.warn("Cannot parse Dynamic Bean class " + tDynamicBeanClassName
				+ ", returning null.", ex);
		return getNullValue();
	}
}
 

开发者ID:krevelen,
项目名称:coala,
代码行数:55,
代码来源:DynamicBeanJacksonDeserializer.java

示例4: DynamicPropertyTypeDeserializer

点赞 2

import com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer; //导入依赖的package包/类
public DynamicPropertyTypeDeserializer(final AsPropertyTypeDeserializer src, final BeanProperty property) {
	super(src, property);
}
 

开发者ID:Treydone,
项目名称:mandrel,
代码行数:4,
代码来源:DynamicPropertyTypeDeserializer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)