XMLEncoder for readonly properties

I have an object wanna to encode with XMLEncoder. It has only getters but no setter, and thus all the readonly properties can not be encoded.Any one has solution to this issue?
[190 byte] By [Hef_onlinea] at [2007-11-27 7:32:14]
# 1

I think that solve your problem; it's about giving the read-only properties when calling the bean constructor.

Make a String array with your private properties, and setup on the XMLEncoder a DefaultaPersistenceDelegate:

XMLEncoder.setDefaultPersistenceDelegate(YorBean.class,

new DefaultPersistenceDelegate(String[] constructorPropertyNames))

stenara at 2007-7-12 19:12:29 > top of Java-index,Desktop,Developing for the Desktop...