jmri.managers.configurexml
Class AbstractLightManagerConfigXML

Show UML class diagram
java.lang.Object
  extended by jmri.configurexml.AbstractXmlAdapter
      extended by jmri.managers.configurexml.AbstractNamedBeanManagerConfigXML
          extended by jmri.managers.configurexml.AbstractLightManagerConfigXML
All Implemented Interfaces:
XmlAdapter
Direct Known Subclasses:
AbstractLightManagerConfigXML, AcelaLightManagerXml, InternalLightManagerXml, LnLightManagerXml, NceLightManagerXml, SerialLightManagerXml, SerialLightManagerXml, SerialLightManagerXml, SerialLightManagerXml, SerialLightManagerXml, SerialLightManagerXml, XNetLightManagerXml

public abstract class AbstractLightManagerConfigXML
extends AbstractNamedBeanManagerConfigXML

Provides the abstract base and store functionality for configuring LightManagers, working with AbstractLightManagers.

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

Based on AbstractSensorManagerConfigXML.java


Constructor Summary
AbstractLightManagerConfigXML()
           
 
Method Summary
abstract  boolean load(Element lights)
          Create a LightManager object of the correct class, then register and fill it.
 boolean loadLights(Element lights)
          Utility method to load the individual Light objects.
abstract  void setStoreElementClass(Element lights)
          Subclass provides implementation to create the correct top element, including the type information.
 Element store(Object o)
          Default implementation for storing the contents of a LightManager
 
Methods inherited from class jmri.configurexml.AbstractXmlAdapter
creationErrorEncountered, setConfigXmlManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.configurexml.XmlAdapter
load
 

Constructor Detail

AbstractLightManagerConfigXML

public AbstractLightManagerConfigXML()
Method Detail

store

public Element store(Object o)
Default implementation for storing the contents of a LightManager

Parameters:
o - Object to store, of type LightManager
Returns:
Element containing the complete info

setStoreElementClass

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

Parameters:
lights - The top-level element being created

load

public abstract boolean load(Element lights)
Create a LightManager object of the correct class, then register and fill it.

Parameters:
lights - Top level Element to unpack.
Returns:
true if successful

loadLights

public boolean loadLights(Element lights)
Utility method to load the individual Light objects. If there's no additional info needed for a specific light type, invoke this with the parent of the set of Light elements.

Parameters:
lights - Element containing the Light elements to load.


Copyright © 1997 - 2010 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads