Interface XMLSerializableWithProgress
-
- All Superinterfaces:
XMLSerializable
- All Known Implementing Classes:
DefaultAlignmentDocument
,DefaultPhylogenyDocument
,DefaultSequenceListDocument
,PhylogenyDocument
public interface XMLSerializableWithProgress extends XMLSerializable
An extended interface toXMLSerializable
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 parametersElement
andProgressListener
thay may throw aXMLSerializationException
. The constructor may throw the XMLSerializationException if the progress listener requests that it cancel. ForPluginDocuments
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportType
-
-
Field Summary
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
ROOT_ELEMENT_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.jdom.Element
toXML(jebl.util.ProgressListener progressListener)
Convert object to a JDOM element.-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
fromXML, toXML
-
-
-
-
Method Detail
-
toXML
org.jdom.Element toXML(jebl.util.ProgressListener progressListener)
Convert object to a JDOM element. The representation should be complete so that the constructor can completely restore the object's representation. It is recommended that the returned element useXMLSerializable.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 callXMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally. PluginDocument implementations of this method may choose to throw anXMLSerializationException
, enclosed in aRuntimeException
.- Parameters:
progressListener
- for reporting progress of the serialization. The implementation may return null if the progress listener requests that it cancel.- Returns:
- object encoded as a JDOM element
- Throws:
java.lang.RuntimeException
- whose cause is aXMLSerializationException
if the serializable class is aPluginDocument
and it is unable to serialize to a temporary file usingPluginDocument.FILE_DATA_ATTRIBUTE_NAME
.
-
-