问题描述
ToStringBuilder.reflectionToString(Object)
显示日期?根据 Apache Commons Lang 2.4文档,ToStringBuilder.reflectionToString(Object)
委托 ReflectionToStringBuilder.toString(Object)
,它通过反射使用默认的ToStringStyle
生成toString
值".因此,默认 ToStringStyle
显示日期?
In what format does ToStringBuilder.reflectionToString(Object)
display dates? According to the Apache Commons Lang 2.4 documentation, ToStringBuilder.reflectionToString(Object)
delegates to ReflectionToStringBuilder.toString(Object)
which "Builds a toString
value using the default ToStringStyle
through reflection." So, in what format does the default ToStringStyle
display dates?
推荐答案
DefaultToStringStyle
只是ToStringStyle
的不可变子类,因此它依赖于处理. ToStringStyle
对日期没有任何特殊处理,因此仅使用Date
的toString
.
DefaultToStringStyle
is just an immutable subclass of ToStringStyle
, so it falls back on that for handling. ToStringStyle
does not have any special handling for dates, so it just uses Date
's toString
.
但是,实际上有一个添加示例.
这篇关于ToStringBuilder.reflectionToString(Object)以什么格式显示日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!