001package jmri.jmrix.loconet.configurexml;
002
003//import jmri.SignalHead;
004import jmri.InstanceManager;
005import jmri.JmriException;
006import jmri.jmrix.loconet.LNCPSignalMast;
007import org.jdom2.Element;
008import org.slf4j.Logger;
009import org.slf4j.LoggerFactory;
010
011//import jmri.managers.configurexml.AbstractNamedBeanManagerConfigXML;
012
013/*import java.util.List;
014 import org.jdom2.DataConversionException;
015 import org.jdom2.Element;*/
016/**
017 * Handle XML configuration for loconet.LNCPSignalMast objects.
018 *
019 * @author Bob Jacobsen Copyright: Copyright (c) 2003, 2008
020 */
021public class LNCPSignalMastXml extends jmri.implementation.configurexml.DccSignalMastXml {
022
023    public LNCPSignalMastXml() {
024    }
025
026    @Override
027    public boolean load(Element shared, Element perNode) {
028        LNCPSignalMast m;
029        String sys = getSystemName(shared);
030        try {
031            m = (LNCPSignalMast) InstanceManager.getDefault(jmri.SignalMastManager.class)
032                    .provideCustomSignalMast(sys, LNCPSignalMast.class);
033        } catch (JmriException e) {
034            log.error("Failed to load DccSignalMast {}", sys, e);
035            return false;
036        }
037
038        if (getUserName(shared) != null) {
039            m.setUserName(getUserName(shared));
040        }
041        return loadCommonDCCMast(m, shared);
042    }
043
044    private final static Logger log = LoggerFactory.getLogger(LNCPSignalMastXml.class);
045
046}