|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ezmorph.object.AbstractObjectMorpher
net.sf.ezmorph.object.DateMorpher
public final class DateMorpher
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).
Constructor Summary | |
---|---|
DateMorpher(java.lang.String[] formats)
|
|
DateMorpher(java.lang.String[] formats,
boolean lenient)
|
|
DateMorpher(java.lang.String[] formats,
java.util.Date defaultValue)
|
|
DateMorpher(java.lang.String[] formats,
java.util.Date defaultValue,
java.util.Locale locale,
boolean lenient)
|
|
DateMorpher(java.lang.String[] formats,
java.util.Locale locale)
|
|
DateMorpher(java.lang.String[] formats,
java.util.Locale locale,
boolean lenient)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.util.Date |
getDefaultValue()
Returns the default value for this Morpher. |
int |
hashCode()
|
java.lang.Object |
morph(java.lang.Object value)
Morphs the input object into an output object of the supported type. |
java.lang.Class |
morphsTo()
Returns the target Class for conversion. |
void |
setDefaultValue(java.util.Date defaultValue)
Sets the defaultValue to use if the value to be morphed is null. |
boolean |
supports(java.lang.Class clazz)
Returns true if the Morpher supports conversion from this Class. Supports any type that is not an Array. |
Methods inherited from class net.sf.ezmorph.object.AbstractObjectMorpher |
---|
isUseDefault, setUseDefault |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateMorpher(java.lang.String[] formats)
formats
- a list of formats this morpher supports.public DateMorpher(java.lang.String[] formats, boolean lenient)
formats
- a list of formats this morpher supports.lenient
- if the parsing should be lenient or not.public DateMorpher(java.lang.String[] formats, java.util.Date defaultValue)
formats
- a list of formats this morpher supports.defaultValue
- return value if the value to be morphed is null.public DateMorpher(java.lang.String[] formats, java.util.Date defaultValue, java.util.Locale locale, boolean lenient)
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.public DateMorpher(java.lang.String[] formats, java.util.Locale locale)
formats
- a list of formats this morpher supports.locale
- the Locale used to parse each format.public DateMorpher(java.lang.String[] formats, java.util.Locale locale, boolean lenient)
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.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Date getDefaultValue()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object morph(java.lang.Object value)
ObjectMorpher
value
- The input value to be morphedpublic java.lang.Class morphsTo()
Morpher
public void setDefaultValue(java.util.Date defaultValue)
defaultValue
- return value if the value to be morphed is nullpublic boolean supports(java.lang.Class clazz)
AbstractObjectMorpher
supports
in interface Morpher
supports
in class AbstractObjectMorpher
clazz
- the source Class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |