I have two classes
class First{
private Date date;
public Date getDate(){
return date;
}
...
}
and
class Second extends First{
@XmlAttribute
@XmlJavaTypeAdapter(value = DateAdapter.class, type = Date.class)
public Date getDate() {
return super.getDate();
}
}
Where DateAdapter just translates Date to Long and back.
I'm serializing an instance of the Second class and it seems to be that DateAdapter is ignored. I mean I get string "2013-05-22T13:32:40.664" instead of its Long representation.
If I'll move the @XmlJavaTypeAdapter annotation to the First class, it works OK, but my problem is that First can't be modified and that is basically the reason I created the wrapper class Second.
How can I make XmlJavaTypeAdapter be recognized?