jmri.managers.configurexml
Class AbstractSignalHeadManagerXml

Show UML class diagram
java.lang.Object
  extended by jmri.configurexml.AbstractXmlAdapter
      extended by jmri.managers.configurexml.AbstractNamedBeanManagerConfigXML
          extended by jmri.managers.configurexml.AbstractSignalHeadManagerXml
All Implemented Interfaces:
XmlAdapter
Direct Known Subclasses:
AbstractSignalHeadManagerXml

public class AbstractSignalHeadManagerXml
extends AbstractNamedBeanManagerConfigXML

Provides the abstract base and store functionality for configuring SignalHeadManagers, working with AbstractSignalHeadManagers.

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

Based on AbstractTurnoutManagerConfigXML


Constructor Summary
AbstractSignalHeadManagerXml()
           
 
Method Summary
 boolean load(Element signalheads)
          Create a SignalHeadManager object of the correct class, then register and fill it.
 void load(Element element, Object o)
          Create a set of configured objects from their XML description, using an auxiliary object.
 void loadSignalHeads(Element signalheads)
          Utility method to load the individual SignalHead objects.
 void setStoreElementClass(Element turnouts)
          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 SignalHeadManager.
 
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
 

Constructor Detail

AbstractSignalHeadManagerXml

public AbstractSignalHeadManagerXml()
Method Detail

store

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

Unlike most other managers, the individual SignalHead objects are stored separately via the configuration system so they can have separate type information.

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

setStoreElementClass

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

Parameters:
turnouts - The top-level element being created

load

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

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

load

public void load(Element element,
                 Object o)
Description copied from interface: XmlAdapter
Create a set of configured objects from their XML description, using an auxiliary object.

For example, the auxilary object o might be a manager or GUI of some type that needs to be informed as each object is created.

Parameters:
element - Top-level XML element containing the description
o - Implementation-specific Object needed for the conversion

loadSignalHeads

public void loadSignalHeads(Element signalheads)
Utility method to load the individual SignalHead objects. If there's no additional info needed for a specific signal head type, invoke this with the parent of the set of SignalHead elements.

Parameters:
signalheads - Element containing the SignalHead 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