热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.fasterxml.jackson.databind.JavaType.withContentType()方法的使用及代码示例

本文整理了Java中com.fasterxml.jackson.databind.JavaType.withContentType()方法的一些代码示例,展示了

本文整理了Java中com.fasterxml.jackson.databind.JavaType.withContentType()方法的一些代码示例,展示了JavaType.withContentType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JavaType.withContentType()方法的具体详情如下:
包路径:com.fasterxml.jackson.databind.JavaType
类名称:JavaType
方法名:withContentType

JavaType.withContentType介绍

[英]Mutant factory method that may be called on structured types that have a so-called content type (element of arrays, value type of Maps, referenced type of referential types), and will construct a new instance that is identical to this instance, except that it has specified content type, instead of current one. If content type is already set to given type, this is returned. If type does not have a content type (which is the case with SimpleType), IllegalArgumentExceptionwill be thrown.
[中]可以对具有所谓内容类型(数组的元素、映射的值类型、引用类型的引用类型)的结构化类型调用的突变工厂方法,并将构造与此实例相同的新实例,只是它指定了内容类型而不是当前类型。如果内容类型已设置为给定类型,则返回this。如果类型没有内容类型(与SimpleType的情况相同),则将抛出IllegalArgumentException。

代码示例

代码示例来源:origin: redisson/redisson

@Override
public JavaType withHandlersFrom(JavaType src) {
JavaType type = super.withHandlersFrom(src);
JavaType srcCt = src.getContentType();
if (srcCt != null) {
JavaType ct = _elementType.withHandlersFrom(srcCt);
if (ct != _elementType) {
type = type.withContentType(ct);
}
}
return type;
}

代码示例来源:origin: redisson/redisson

@Override
public JavaType withHandlersFrom(JavaType src) {
JavaType type = super.withHandlersFrom(src);
JavaType srcKeyType = src.getKeyType();
// "withKeyType()" not part of JavaType, hence must verify:
if (type instanceof MapLikeType) {
if (srcKeyType != null) {
JavaType ct = _keyType.withHandlersFrom(srcKeyType);
if (ct != _keyType) {
type = ((MapLikeType) type).withKeyType(ct);
}
}
}
JavaType srcCt = src.getContentType();
if (srcCt != null) {
JavaType ct = _valueType.withHandlersFrom(srcCt);
if (ct != _valueType) {
type = type.withContentType(ct);
}
}
return type;
}

代码示例来源:origin: redisson/redisson

type = type.withContentType(contentType);

代码示例来源:origin: redisson/redisson

try {
cOntentType= tf.constructSpecializedType(contentType, contentClass);
type = type.withContentType(contentType);
} catch (IllegalArgumentException iae) {
throw new JsonMappingException(null,

代码示例来源:origin: com.fasterxml.jackson.module/jackson-module-jaxb-annotations

return baseType.withContentType(contentType);
} catch (IllegalArgumentException iae) {
throw new JsonMappingException(null,

代码示例来源:origin: com.fasterxml.jackson.module/jackson-module-jaxb-annotations

return baseType.withContentType(contentType);

代码示例来源:origin: Nextdoor/bender

@Override
public JavaType withHandlersFrom(JavaType src) {
JavaType type = super.withHandlersFrom(src);
JavaType srcCt = src.getContentType();
if (srcCt != null) {
JavaType ct = _elementType.withHandlersFrom(srcCt);
if (ct != _elementType) {
type = type.withContentType(ct);
}
}
return type;
}

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

@Override
public JavaType withHandlersFrom(JavaType src) {
JavaType type = super.withHandlersFrom(src);
JavaType srcCt = src.getContentType();
if (srcCt != null) {
JavaType ct = _elementType.withHandlersFrom(srcCt);
if (ct != _elementType) {
type = type.withContentType(ct);
}
}
return type;
}

代码示例来源:origin: cn.jeeweb/jeeweb-common-query

.withContentType((JavaType)((ParameterizedType) type).getActualTypeArguments()[0]);

代码示例来源:origin: FasterXML/jackson-module-jaxb-annotations

return baseType.withContentType(contentType);
} catch (IllegalArgumentException iae) {
throw new JsonMappingException(null,

代码示例来源:origin: Nextdoor/bender

return baseType.withContentType(contentType);
} catch (IllegalArgumentException iae) {
throw new JsonMappingException(null,

代码示例来源:origin: Nextdoor/bender

return baseType.withContentType(contentType);

代码示例来源:origin: FasterXML/jackson-module-jaxb-annotations

return baseType.withContentType(contentType);

代码示例来源:origin: Nextdoor/bender

try {
cOntentType= tf.constructSpecializedType(contentType, contentClass);
type = type.withContentType(contentType);
} catch (IllegalArgumentException iae) {
throw new JsonMappingException(null,

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

@Override
public JavaType withHandlersFrom(JavaType src) {
JavaType type = super.withHandlersFrom(src);
JavaType srcKeyType = src.getKeyType();
// "withKeyType()" not part of JavaType, hence must verify:
if (type instanceof MapLikeType) {
if (srcKeyType != null) {
JavaType ct = _keyType.withHandlersFrom(srcKeyType);
if (ct != _keyType) {
type = ((MapLikeType) type).withKeyType(ct);
}
}
}
JavaType srcCt = src.getContentType();
if (srcCt != null) {
JavaType ct = _valueType.withHandlersFrom(srcCt);
if (ct != _valueType) {
type = type.withContentType(ct);
}
}
return type;
}

代码示例来源:origin: Nextdoor/bender

@Override
public JavaType withHandlersFrom(JavaType src) {
JavaType type = super.withHandlersFrom(src);
JavaType srcKeyType = src.getKeyType();
// "withKeyType()" not part of JavaType, hence must verify:
if (type instanceof MapLikeType) {
if (srcKeyType != null) {
JavaType ct = _keyType.withHandlersFrom(srcKeyType);
if (ct != _keyType) {
type = ((MapLikeType) type).withKeyType(ct);
}
}
}
JavaType srcCt = src.getContentType();
if (srcCt != null) {
JavaType ct = _valueType.withHandlersFrom(srcCt);
if (ct != _valueType) {
type = type.withContentType(ct);
}
}
return type;
}

代码示例来源:origin: Nextdoor/bender

type = type.withContentType(contentType);

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

try {
cOntentType= tf.constructSpecializedType(contentType, contentClass);
type = type.withContentType(contentType);
} catch (IllegalArgumentException iae) {
throw new JsonMappingException(null,

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

type = type.withContentType(contentType);

推荐阅读
author-avatar
雲悳蕲黇
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有