Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
带水的鱼儿
spring-framework
提交
6251222a
S
spring-framework
项目概览
带水的鱼儿
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6251222a
编写于
6月 08, 2021
作者:
S
Sébastien Deleuze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove jackson-module-kotlin warning
Closes gh-26962
上级
05eca056
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
12 deletion
+6
-12
spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java
...work/http/converter/json/Jackson2ObjectMapperBuilder.java
+1
-7
src/docs/asciidoc/languages/kotlin.adoc
src/docs/asciidoc/languages/kotlin.adoc
+5
-5
未找到文件。
spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java
浏览文件 @
6251222a
...
...
@@ -105,8 +105,6 @@ import org.springframework.util.xml.StaxUtils;
*/
public
class
Jackson2ObjectMapperBuilder
{
private
static
volatile
boolean
kotlinWarningLogged
;
private
final
Log
logger
=
HttpLogging
.
forLogName
(
getClass
());
private
final
Map
<
Class
<?>,
Class
<?>>
mixIns
=
new
LinkedHashMap
<>();
...
...
@@ -863,11 +861,7 @@ public class Jackson2ObjectMapperBuilder {
modulesToRegister
.
set
(
kotlinModule
.
getTypeId
(),
kotlinModule
);
}
catch
(
ClassNotFoundException
ex
)
{
if
(!
kotlinWarningLogged
)
{
kotlinWarningLogged
=
true
;
logger
.
warn
(
"For Jackson Kotlin classes support please add "
+
"\"com.fasterxml.jackson.module:jackson-module-kotlin\" to the classpath"
);
}
// jackson-module-kotlin not available
}
}
}
...
...
src/docs/asciidoc/languages/kotlin.adoc
浏览文件 @
6251222a
...
...
@@ -31,6 +31,11 @@ and https://bintray.com/bintray/jcenter/org.jetbrains.kotlin%3Akotlin-reflect[`k
to be present on the classpath. They are provided by default if you bootstrap a Kotlin project on
https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io].
NOTE: The https://github.com/FasterXML/jackson-module-kotlin[Jackson Kotlin module] is required
for serializing or deserializing JSON data for Kotlin classes with Jackson, so make sure to add the
`com.fasterxml.jackson.module:jackson-module-kotlin` dependency to your project if you have such need.
It is automatically registered when found in the classpath.
[[kotlin-extensions]]
== Extensions
...
...
@@ -120,11 +125,6 @@ Kotlin parameter names are recognized through a dedicated `KotlinReflectionParam
which allows finding interface method parameter names without requiring the Java 8 `-parameters`
compiler flag to be enabled during compilation.
The https://github.com/FasterXML/jackson-module-kotlin[Jackson Kotlin module], which is required
for serializing or deserializing JSON data, is automatically registered when
found in the classpath, and a warning message is logged if Jackson and Kotlin are
detected without the Jackson Kotlin module being present.
You can declare configuration classes as
https://kotlinlang.org/docs/reference/nested-classes.html[top level or nested but not inner],
since the later requires a reference to the outer class.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录