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
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 Enum<T>>, AbstractXmlAdapter.EnumIoMapped<T extends Enum<T>>, AbstractXmlAdapter.EnumIoNames<T extends Enum<T>>, AbstractXmlAdapter.EnumIoNamesNumbers<T extends Enum<T>>, AbstractXmlAdapter.EnumIoOrdinals<T extends Enum<T>> -
Field Summary
Fields inherited from class jmri.configurexml.AbstractXmlAdapter
STR_FALSE, STR_NO, STR_TRUE, STR_YES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddispose()protected voidextendElement(org.jdom2.Element e) Customizable method if you need to add anything moreprotected StringfindParmValue(org.jdom2.Element e, String name) Service routine to look through "parameter" child elements to find a particular parameter valueprotected abstract voidprotected voidloadCommon(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter) Load common attributes and elements.protected voidloadOptions(org.jdom2.Element shared, org.jdom2.Element perNode, PortAdapter adapter) load optionsprotected abstract voidregister()protected voidprotected voidsaveOptions(org.jdom2.Element e, PortAdapter adapter) save optionsprotected voidsetOutputInterval(PortAdapter adapter, org.jdom2.Element e) Store the outputInterval in a connection element for persistence.org.jdom2.ElementStore the object in XMLprotected voidstoreCommon(org.jdom2.Element e, PortAdapter adapter) protected voidunpackElement(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, setExceptionHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.configurexml.XmlAdapter
store
-
Constructor Details
-
AbstractConnectionConfigXml
public AbstractConnectionConfigXml()
-
-
Method Details
-
getInstance
-
register
-
register
-
store
Description copied from class:AbstractXmlAdapterStore the object in XML- Specified by:
storein interfaceXmlAdapter- Overrides:
storein 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
-
extendElement
Customizable method if you need to add anything more- Parameters:
e- Element being created, update as needed
-
loadCommon
Load common attributes and elements.- Parameters:
shared- the shared elementperNode- the per node elementadapter- the port adapter
-
saveOptions
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
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
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
Store the outputInterval in a connection element for persistence.- Parameters:
adapter- the adapter for which properties are storede- the "connection" element being filled
-
dispose
-