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