How to serialize Java 2D Shape objects as XML?
问题 The Shape interface is implemented by objects of Java 2D ( Arc2D , Area , CubicCurve2D , Ellipse2D , GeneralPath etc..). Some of the concrete objects are marked as Serializable and can be stored and restored using object serialization, but others like Area do not implement the interface and throw errors. But since we are constantly warned that such naive serialization is not necessarily stable across Java implementations or versions, I'd prefer to use some form of serialization that is. That