001package jmri.jmrix.zimo.mx1.configurexml; 002 003import jmri.jmrix.configurexml.AbstractSerialConnectionConfigXml; 004import jmri.jmrix.zimo.mx1.ConnectionConfig; 005import jmri.jmrix.zimo.mx1.Mx1Adapter; 006 007/** 008 * Handle XML persistance of layout connections by persistening the Mx1Adapter 009 * (and connections). Note this is named as the XML version of a 010 * ConnectionConfig object, but it's actually persisting the Mx1Adapter. 011 * <p> 012 * This class is invoked from jmrix.JmrixConfigPaneXml on write, as that class 013 * is the one actually registered. Reads are brought here directly via the class 014 * attribute in the XML. 015 * 016 * @author Bob Jacobsen Copyright: Copyright (c) 2003 017 */ 018public class ConnectionConfigXml extends AbstractSerialConnectionConfigXml { 019 020 public ConnectionConfigXml() { 021 super(); 022 } 023 024 @Override 025 protected void getInstance() { 026 adapter = new Mx1Adapter(); 027 } 028 029 @Override 030 protected void getInstance(Object object) { 031 adapter = ((ConnectionConfig) object).getAdapter(); 032 } 033 034 @Override 035 protected void register() { 036 this.register(new ConnectionConfig(adapter)); 037 } 038 039}