类 DateMorpher
java.lang.Object
com.sh.json.ezmorph.object.AbstractObjectMorpher
com.sh.json.ezmorph.object.DateMorpher
- 所有已实现的接口:
Morpher,ObjectMorpher
Morphs a String to a Date.
This morpher will iterate through the supplied formats until one succeeds or the default value is returned (if default value is configured).
-
构造器概要
构造器构造器说明DateMorpher(String[] formats) DateMorpher(String[] formats, boolean lenient) DateMorpher(String[] formats, Date defaultValue) DateMorpher(String[] formats, Date defaultValue, Locale locale, boolean lenient) DateMorpher(String[] formats, Locale locale) DateMorpher(String[] formats, Locale locale, boolean lenient) -
方法概要
修饰符和类型方法说明booleanReturns the default value for this Morpher.inthashCode()Morphs the input object into an output object of the supported type.Class<?>morphsTo()Returns the target Class for conversion.voidsetDefaultValue(Date defaultValue) Sets the defaultValue to use if the value to be morphed is null.booleanReturns true if the Morpher supports conversion from this Class.
Supports any type that is not an Array.从类继承的方法 com.sh.json.ezmorph.object.AbstractObjectMorpher
isUseDefault, setUseDefault
-
构造器详细资料
-
DateMorpher
- 参数:
formats- a list of formats this morpher supports.
-
DateMorpher
- 参数:
formats- a list of formats this morpher supports.lenient- if the parsing should be lenient or not.
-
DateMorpher
- 参数:
formats- a list of formats this morpher supports.defaultValue- return value if the value to be morphed is null.
-
DateMorpher
- 参数:
formats- a list of formats this morpher supports.defaultValue- return value if the value to be morphed is null.locale- the Locale used to parse each format.lenient- if the parsing should be lenient or not.
-
DateMorpher
- 参数:
formats- a list of formats this morpher supports.locale- the Locale used to parse each format.
-
DateMorpher
- 参数:
formats- a list of formats this morpher supports.locale- the Locale used to parse each format.lenient- if the parsing should be lenient or not.
-
-
方法详细资料
-
equals
-
getDefaultValue
Returns the default value for this Morpher. -
hashCode
public int hashCode() -
morph
从接口复制的说明:ObjectMorpherMorphs the input object into an output object of the supported type.- 参数:
value- The input value to be morphed
-
morphsTo
从接口复制的说明:MorpherReturns the target Class for conversion.- 返回:
- the target Class for conversion.
-
setDefaultValue
Sets the defaultValue to use if the value to be morphed is null.- 参数:
defaultValue- return value if the value to be morphed is null
-
supports
从类复制的说明:AbstractObjectMorpherReturns true if the Morpher supports conversion from this Class.
Supports any type that is not an Array.- 指定者:
supports在接口中Morpher- 覆盖:
supports在类中AbstractObjectMorpher- 参数:
clazz- the source Class- 返回:
- true if clazz is supported by this morpher, false otherwise.
-