jmri.configurexml.turnoutoperations
Class TurnoutOperationXml

java.lang.Object
  extended by jmri.configurexml.AbstractXmlAdapter
      extended by 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.

Author:
John Harper Copyright 2005

Constructor Summary
TurnoutOperationXml()
           
 
Method Summary
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(Element e)
          inherited methods
 void load(Element element, Object o)
          Create a set of configured objects from their XML description, using an auxiliary object.
abstract  TurnoutOperation loadOne(Element e)
           
static TurnoutOperation loadOperation(Element e)
          Load one operation, using the appropriate adapter
 Element store(Object o)
          common part of store - create the element and store the name and the class
 
Methods inherited from class jmri.configurexml.AbstractXmlAdapter
creationErrorEncountered, getConfigXmlManager, loadDeferred, loadOrder, setConfigXmlManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TurnoutOperationXml

public TurnoutOperationXml()
Method Detail

load

public boolean load(Element e)
             throws Exception
inherited methods

Parameters:
e - Top-level XML element containing the description
Returns:
true if successful
Throws:
Exception - when a error prevents creating the objects as as required by the input XML.
See Also:
XmlAdapter.load(org.jdom.Element)

loadOne

public abstract TurnoutOperation loadOne(Element e)

loadOperation

public static TurnoutOperation loadOperation(Element e)
Load one operation, using the appropriate adapter

Parameters:
e - element for operation

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
See Also:
XmlAdapter.load(org.jdom.Element, java.lang.Object)

store

public Element store(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


Copyright © 1997 - 2011 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