Class AbstractConnectionConfigXml

java.lang.Object
jmri.configurexml.AbstractXmlAdapter
jmri.jmrix.configurexml.AbstractConnectionConfigXml
All Implemented Interfaces:
XmlAdapter
Direct Known Subclasses:
AbstractNetworkConnectionConfigXml, AbstractSerialConnectionConfigXml, AbstractStreamConnectionConfigXml, AbstractUsbConnectionConfigXml, ConnectionConfigXml, ConnectionConfigXml, ConnectionConfigXml, IpocsConnectionConfigXml, RaspberryPiConnectionConfigXml, RaspberryPiSimulatorConnectionConfigXml

public abstract class AbstractConnectionConfigXml extends AbstractXmlAdapter
Abstract base (and partial implementation) for classes persisting the status of connections.
  • Constructor Details

  • Method Details

    • getInstance

      protected abstract void getInstance()
    • register

      protected abstract void register()
    • register

      protected void register(ConnectionConfig c)
    • store

      public org.jdom2.Element store(Object o, boolean shared)
      Description copied from class: AbstractXmlAdapter
      Store the object in XML
      Specified by:
      store in interface XmlAdapter
      Overrides:
      store in class AbstractXmlAdapter
      Parameters:
      o - The object to be recorded. Specific XmlAdapter implementations will require this to be of a specific type; that binding is done in ConfigXmlManager.
      shared - true if the returned element should be the common XML and false if the returned element should be per-node.
      Returns:
      The XML representation Element
    • storeCommon

      protected void storeCommon(org.jdom2.Element e, PortAdapter adapter)
    • extendElement

      protected void extendElement(org.jdom2.Element e)
      Customizable method if you need to add anything more
      Parameters:
      e - Element being created, update as needed
    • loadCommon

      protected void loadCommon(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter)
      Load common attributes and elements.
      Parameters:
      shared - the shared element
      perNode - the per node element
      adapter - the port adapter
    • saveOptions

      protected void saveOptions(org.jdom2.Element e, PortAdapter adapter)
      save options
      Parameters:
      e - the element
      adapter - the port adapter
    • loadOptions

      protected void loadOptions(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter)
      load options
      Parameters:
      shared - the shared element
      perNode - the per node element
      adapter - the port adapter
    • unpackElement

      protected void unpackElement(org.jdom2.Element shared, org.jdom2.Element perNode)
      Method to unpack additional XML structures after connection creation, but before connection is usable.
      Parameters:
      shared - connection information common to all nodes
      perNode - connection information unique to this node
    • findParmValue

      protected String findParmValue(org.jdom2.Element e, String name)
      Service routine to look through "parameter" child elements to find a particular parameter value
      Parameters:
      e - Element containing parameters
      name - name of desired parameter
      Returns:
      String value
    • setOutputInterval

      protected void setOutputInterval(PortAdapter adapter, org.jdom2.Element e)
      Store the outputInterval in a connection element for persistence.
      Parameters:
      adapter - the adapter for which properties are stored
      e - the "connection" element being filled
    • dispose

      protected abstract void dispose()