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