Class TurnoutOperationXml
- java.lang.Object
-
- jmri.configurexml.AbstractXmlAdapter
-
- jmri.configurexml.turnoutoperations.TurnoutOperationXml
-
- All Implemented Interfaces:
XmlAdapter
- Direct Known Subclasses:
CommonTurnoutOperationXml
public abstract class TurnoutOperationXml extends AbstractXmlAdapter
Superclass for save/restore of TurnoutOperation subclasses in XML.
-
-
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 TurnoutOperationXml()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TurnoutOperationXml
getAdapter(TurnoutOperation op)
Given an instance of a concrete subclass of the TurnoutOperation class, looks for a corresponding ...Xml class and creates an instance of it.boolean
load(org.jdom2.Element shared, org.jdom2.Element perNode)
Create a set of configured objects from their XML description.abstract TurnoutOperation
loadOne(org.jdom2.Element e)
static TurnoutOperation
loadOperation(org.jdom2.Element e)
Load one operation, using the appropriate adapterorg.jdom2.Element
store(java.lang.Object o)
common part of store - create the element and store the name and the class-
Methods inherited from class jmri.configurexml.AbstractXmlAdapter
getAttributeBooleanValue, getAttributeDoubleValue, getAttributeFloatValue, getAttributeIntegerValue, getExceptionHandler, handleException, load, load, load, loadDeferred, loadOrder, setExceptionHandler, store
-
-
-
-
Constructor Detail
-
TurnoutOperationXml
public TurnoutOperationXml()
-
-
Method Detail
-
load
public boolean load(org.jdom2.Element shared, org.jdom2.Element perNode)
Description copied from class:AbstractXmlAdapter
Create a set of configured objects from their XML description.- Specified by:
load
in interfaceXmlAdapter
- Overrides:
load
in classAbstractXmlAdapter
- Parameters:
shared
- Top-level XML element containing the common, multi-node elements of the descriptionperNode
- Top-level XML element containing the private, single-node elements of the description- Returns:
- true if successful
-
loadOne
public abstract TurnoutOperation loadOne(org.jdom2.Element e)
-
loadOperation
public static TurnoutOperation loadOperation(org.jdom2.Element e)
Load one operation, using the appropriate adapter- Parameters:
e
- element for operation- Returns:
- the loaded TurnoutOperation or null if unable to load from e
-
store
public org.jdom2.Element store(java.lang.Object o)
common part of store - create the element and store the name and the class- Parameters:
o
- TurnoutOperation object- Returns:
- partially filled element
-
getAdapter
public static TurnoutOperationXml getAdapter(TurnoutOperation op)
Given an instance of a concrete subclass of the TurnoutOperation class, looks for a corresponding ...Xml class and creates an instance of it. If anything goes wrong (no such class, wrong constructors, instantiation error, ....) just return null- Parameters:
op
- operation for which configurator is required- Returns:
- the configurator
-
-