001package jmri.jmrit.logixng.expressions.configurexml;
002
003import jmri.InstanceManager;
004import jmri.jmrit.logixng.DigitalExpressionManager;
005import jmri.jmrit.logixng.expressions.False;
006
007import org.jdom2.Element;
008
009import jmri.jmrit.logixng.DigitalExpressionBean;
010
011/**
012 * Handle XML configuration for ActionLightXml objects.
013 *
014 * @author Bob Jacobsen Copyright: Copyright (c) 2004, 2008, 2010
015 * @author Daniel Bergqvist Copyright (C) 2019
016 */
017public class FalseXml extends jmri.managers.configurexml.AbstractNamedBeanManagerConfigXML {
018
019    public FalseXml() {
020    }
021    
022    /**
023     * Default implementation for storing the contents of a SE8cSignalHead
024     *
025     * @param o Object to store, of type TripleFalseSignalHead
026     * @return Element containing the complete info
027     */
028    @Override
029    public Element store(Object o) {
030        False p = (False) o;
031
032        Element element = new Element("False");
033        element.setAttribute("class", this.getClass().getName());
034        element.addContent(new Element("systemName").addContent(p.getSystemName()));
035        
036        storeCommon(p, element);
037
038        return element;
039    }
040    
041    @Override
042    public boolean load(Element shared, Element perNode) {
043        String sys = getSystemName(shared);
044        String uname = getUserName(shared);
045        DigitalExpressionBean h = new False(sys, uname);
046
047        loadCommon(h, shared);
048
049        InstanceManager.getDefault(DigitalExpressionManager.class).registerExpression(h);
050        return true;
051    }
052    
053//    private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(FalseXml.class);
054}