jmri.configurexml
Class AbstractSensorManagerConfigXML

java.lang.Object
  extended by jmri.configurexml.AbstractSensorManagerConfigXML
All Implemented Interfaces:
XmlAdapter
Direct Known Subclasses:
AcelaSensorManagerXml, InternalSensorManagerXml, LnSensorManagerXml, NceSensorManagerXml, RpsSensorManagerXml, SerialSensorManagerXml, SerialSensorManagerXml, SerialSensorManagerXml, SerialSensorManagerXml, SerialSensorManagerXml, SerialSensorManagerXml, XNetSensorManagerXml

public abstract class AbstractSensorManagerConfigXML
extends Object
implements XmlAdapter

Provides the abstract base and store functionality for configuring SensorManagers, working with AbstractSensorManagers.

Typically, a subclass will just implement the load(Element sensors) class, relying on implementation here to load the individual sensors. Note that these are stored explicitly, so the resolution mechanism doesn't need to see *Xml classes for each specific Sensor or AbstractSensor subclass at store time.

Author:
Bob Jacobsen Copyright: Copyright (c) 2002

Constructor Summary
AbstractSensorManagerConfigXML()
           
 
Method Summary
abstract  void load(org.jdom.Element sensors)
          Create a SensorManager object of the correct class, then register and fill it.
 void loadSensors(org.jdom.Element sensors)
          Utility method to load the individual Sensor objects.
abstract  void setStoreElementClass(org.jdom.Element sensors)
          Subclass provides implementation to create the correct top element, including the type information.
 org.jdom.Element store(Object o)
          Default implementation for storing the contents of a SensorManager
 
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
load
 

Constructor Detail

AbstractSensorManagerConfigXML

public AbstractSensorManagerConfigXML()
Method Detail

store

public org.jdom.Element store(Object o)
Default implementation for storing the contents of a SensorManager

Specified by:
store in interface XmlAdapter
Parameters:
o - Object to store, of type SensorManager
Returns:
Element containing the complete info

setStoreElementClass

public abstract void setStoreElementClass(org.jdom.Element sensors)
Subclass provides implementation to create the correct top element, including the type information. Default implementation is to use the local class here.

Parameters:
sensors - The top-level element being created

load

public abstract void load(org.jdom.Element sensors)
Create a SensorManager object of the correct class, then register and fill it.

Specified by:
load in interface XmlAdapter
Parameters:
sensors - Top level Element to unpack.

loadSensors

public void loadSensors(org.jdom.Element sensors)
Utility method to load the individual Sensor objects. If there's no additional info needed for a specific sensor type, invoke this with the parent of the set of Sensor elements.

Parameters:
sensors - Element containing the Sensor elements to load.


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo