Class PluginDocumentXmlCollection


  • public class PluginDocumentXmlCollection
    extends java.lang.Object
    Provides a system for serializing and deserializing a PluginDocument that contains a large number of sub-elements so that all the elements do not need to be in memory simultaneously.

    This is used for example when serializing DefaultSequenceListDocument and DefaultAlignmentDocument, each of which may contain millions of sequences which would take up too much memory if all the contained sequences were simultaneously in memory in their XML form.

    • Constructor Detail

      • PluginDocumentXmlCollection

        public PluginDocumentXmlCollection()
    • Method Detail

      • toXml

        public static org.jdom.Element toXml​(org.jdom.Element rootElement,
                                             java.lang.Iterable<org.jdom.Element> childElements,
                                             int childElementsSize,
                                             jebl.util.ProgressListener progressListener,
                                             boolean serializeToFileInsteadOfMemory)
                                      throws XMLSerializationException
        Serializes these elements into a single parent element, potentially storing them in a file (using PluginDocument.FILE_DATA_ATTRIBUTE_NAME)
        Parameters:
        rootElement - the root element under which to store the child elements (or the element on which to attach the file data attribute if there are too many child elements)
        childElements - the child elements to serialize. These may be added directly to a parent element, so they must not already be a child element of some other element.
        childElementsSize - the number of elements that are in childElements.
        progressListener - for reporting progress and handling cancelling.
        serializeToFileInsteadOfMemory - true to serialized to a file instead of in memory.
        Returns:
        rootElement
        Throws:
        XMLSerializationException