001package jmri.jmrix.can.cbus.configurexml;
002
003import jmri.configurexml.JmriConfigureXmlException;
004import org.jdom2.Element;
005import org.slf4j.Logger;
006import org.slf4j.LoggerFactory;
007
008/**
009 * Provides load and store functionality for configuring CbusSensorManagers.
010 * <p>
011 * Uses the store method from the abstract base class, but provides a load
012 * method here.
013 *
014 * @author Bob Jacobsen Copyright: Copyright (c) 2008
015 * @since 2.3.1
016 */
017public class CbusSensorManagerXml extends jmri.managers.configurexml.AbstractSensorManagerConfigXML {
018
019    public CbusSensorManagerXml() {
020        super();
021    }
022
023    /**
024     * {@inheritDoc}
025     */
026    @Override
027    public void setStoreElementClass(Element sensors) {
028        sensors.setAttribute("class", this.getClass().getName());
029    }
030
031    /**
032     * {@inheritDoc}
033     */
034    @Override
035    public void load(Element element, Object o) {
036        log.error("Invalid method called");
037    }
038
039    /**
040     * {@inheritDoc}
041     */
042    @Override
043    public boolean load(Element shared, Element perNode) throws JmriConfigureXmlException {
044        // load individual sensors
045        // Request the status of these sensors from the layout, if appropriate.
046        //mgr.updateAll();
047        return loadSensors(shared);
048    }
049
050    private final static Logger log = LoggerFactory.getLogger(CbusSensorManagerXml.class);
051}