I receive an XML response with an attribute which contains following value:
Wed Sep 05 10:56:13 CEST 2012
I have defined in my model class a field with annotation:
@Attribute(name = "regDate")
private Date registerDate;
However it throws an exception:
java.text.ParseException: Unparseable date: "Wed Sep 05 10:56:13 CEST 2012" (at offset 0)
Is it possible to define date format in SimpleFramework
's annotations ?
What format should cover this date string ?
SimpleXML only supports some
DateFormat
's:(For the meaning of each character see SimpleDateFormat API Doc (Java SE 7))
However it's possible to write a custom
Transform
who deals with other formats:Transform
Corresponding Annotation
Note 1:
required=true
is optionalHow to use it