Hi all
I have a Javbean which extends java.awt.Color(Which doesn't have a no argument constructor) and when i try to write the class using XMLEncoder its throwing Exception as a custom persistance delegator needs to be there
My custom
java bean looks like
Class CustomColor extends java.awt.Color
{
public CustomColor(Color c)
{
super(c.getRed(), c.getGreen(), c.getBlue());
// Some more variables
}
}
How to set the new PersistanceDelegate for this class ??
I tried to use
encoder.setPersistenceDelegate(CustomColor.class,
new DefaultPersistenceDelegate(
new
String[]{ "red",
"green",
"blue" }) );
But its not working ... I am not in a position to make that bean with out a constructor and provide a set and get methods for it
Can any one let me know how to write Delegates for this class ??