Class DefaultAudioManagerXml

  • All Implemented Interfaces:
    XmlAdapter

    public class DefaultAudioManagerXml
    extends AbstractAudioManagerConfigXML
    Persistency implementation for the default AudioManager persistence.

    The state of audio objects is not persisted, just their existence.


    This file is part of JMRI.

    JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

    JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    • Method Detail

      • setStoreElementClass

        public void setStoreElementClass​(org.jdom2.Element audio)
        Subclass provides implementation to create the correct top element, including the type information. Default implementation is to use the local class here.
        Specified by:
        setStoreElementClass in class AbstractAudioManagerConfigXML
        Parameters:
        audio - The top-level element being created
      • load

        public boolean load​(org.jdom2.Element shared,
                            org.jdom2.Element perNode)
        Create a AudioManager object of the correct class, then register and fill it.
        Specified by:
        load in interface XmlAdapter
        Overrides:
        load in class AbstractXmlAdapter
        Parameters:
        shared - Top level Element to unpack.
        perNode - Per-node top level Element to unpack.
        Returns:
        true if successful