public interface XMLSerializableWithProgress extends XMLSerializable
XMLSerializable to support providing progress (and the ability to cancel)
when serializing and deserialing.
This would ideally replace XMLSerializable, but we can't do that without breaking backwards compatibility with the API.
All implementations of XMLSerializableWithProgress must provide a constructor with parameters
Element and ProgressListener thay may throw a XMLSerializationException.
The constructor may throw the XMLSerializationException if the progress listener requests that it cancel.
For PluginDocuments that implement XMLSerializableWithProgress there is also an additional
requirement that they have an empty constructor and a fromXML(Element, ProgressListener) method which may throw an XMLSerializationException. This is required due to some special run time sub-classing of PluginDocuments that takes place.XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeROOT_ELEMENT_NAME| Modifier and Type | Method and Description |
|---|---|
org.jdom.Element |
toXML(ProgressListener progressListener)
Convert object to a JDOM element.
|
fromXML, toXMLorg.jdom.Element toXML(ProgressListener progressListener)
XMLSerializable.ROOT_ELEMENT_NAME as its name,
in which case it must not define an attribute called "type". In this case,
fromXML, will be called with an element whose name may differ from the element
return from this function. This recommendation allows a more compact representation
of the XML can be stored.
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally.
PluginDocument implementations of this method may choose to throw an XMLSerializationException,
enclosed in a RuntimeException.progressListener - for reporting progress of the serialization. The implementation may return null if the progress listener requests that it cancel.RuntimeException - whose cause is a XMLSerializationException if the serializable class is a PluginDocument and it is unable to serialize to a temporary file using PluginDocument.FILE_DATA_ATTRIBUTE_NAME.