Package jmri.jmrix.configurexml
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.configurexml.AbstractXmlAdapter
AbstractXmlAdapter.EnumIO<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoMapped<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoNames<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoNamesNumbers<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoOrdinals<T extends java.lang.Enum<T>>
-
-
Constructor Summary
Constructors Constructor Description AbstractConnectionConfigXml()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
dispose()
protected void
extendElement(org.jdom2.Element e)
Customizable method if you need to add anything moreprotected java.lang.String
findParmValue(org.jdom2.Element e, java.lang.String name)
Service routine to look through "parameter" child elements to find a particular parameter valueprotected abstract void
getInstance()
protected void
loadCommon(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter)
Load common attributes and elements.protected void
loadOptions(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter)
load optionsprotected abstract void
register()
protected void
register(ConnectionConfig c)
protected void
saveOptions(org.jdom2.Element e, PortAdapter adapter)
save optionsprotected void
setOutputInterval(PortAdapter adapter, org.jdom2.Element e)
Store the outputInterval in a connection element for persistence.org.jdom2.Element
store(java.lang.Object o, boolean shared)
Store the object in XMLprotected void
storeCommon(org.jdom2.Element e, PortAdapter adapter)
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.-
Methods inherited from class jmri.configurexml.AbstractXmlAdapter
getAttributeBooleanValue, getAttributeDoubleValue, getAttributeFloatValue, getAttributeIntegerValue, getExceptionHandler, handleException, load, load, load, load, loadDeferred, loadOrder, setExceptionHandler
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.configurexml.XmlAdapter
store
-
-
-
-
Constructor Detail
-
AbstractConnectionConfigXml
public AbstractConnectionConfigXml()
-
-
Method Detail
-
getInstance
protected abstract void getInstance()
-
register
protected abstract void register()
-
register
protected void register(ConnectionConfig c)
-
store
public org.jdom2.Element store(java.lang.Object o, boolean shared)
Description copied from class:AbstractXmlAdapter
Store the object in XML- Specified by:
store
in interfaceXmlAdapter
- Overrides:
store
in classAbstractXmlAdapter
- 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 elementperNode
- the per node elementadapter
- the port adapter
-
saveOptions
protected void saveOptions(org.jdom2.Element e, PortAdapter adapter)
save options- Parameters:
e
- the elementadapter
- the port adapter
-
loadOptions
protected void loadOptions(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter)
load options- Parameters:
shared
- the shared elementperNode
- the per node elementadapter
- 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 nodesperNode
- connection information unique to this node
-
findParmValue
protected java.lang.String findParmValue(org.jdom2.Element e, java.lang.String name)
Service routine to look through "parameter" child elements to find a particular parameter value- Parameters:
e
- Element containing parametersname
- 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 storede
- the "connection" element being filled
-
dispose
protected abstract void dispose()
-
-