jmri.configurexml
Class AbstractXmlAdapter

java.lang.Object
  extended by jmri.configurexml.AbstractXmlAdapter
All Implemented Interfaces:
XmlAdapter
Direct Known Subclasses:
AbstractConnectionConfigXml, AbstractNamedBeanManagerConfigXML, AbstractNetworkConnectionConfigXml, AbstractSerialConnectionConfigXml, AnalogClock2DisplayXml, BlockBossLogicXml, ControlPanelEditorXml, CreateButtonModelXml, CreateButtonPanelXml, DccLocoAddressXml, DefaultJavaBeanConfigXML, DefaultUserMessagePreferencesXml, EcosPreferencesXml, FileHistoryXml, FileLocationPaneXml, GuiLafConfigPaneXml, JmrixConfigPaneXml, LayoutEditorXml, LayoutMemoryIconXml, LayoutPositionableLabelXml, LayoutSensorIconXml, LayoutSignalHeadIconXml, LayoutTurnoutXml, LayoutTurntableXml, LevelXingXml, LnSecurityElementManagerXml, LocoAddressXml, ManagerDefaultsConfigPaneXml, ManagerDefaultSelectorXml, OBlockManagerXml, PanelEditorXml, PerformActionModelXml, PerformActionPanelXml, PerformFileModelXml, PerformFilePanelXml, PerformScriptModelXml, PerformScriptPanelXml, PositionableLabelXml, PositionablePointXml, ProgrammerConfigPaneXml, ProxyTurnoutManagerXml, RevHistoryXml, RosterConfigPaneXml, SecurityElementIconXml, SimpleTimebaseXml, SystemConsoleConfigPanelXml, TrackSegmentXml, TurnoutOperationManagerXml, TurnoutOperationXml, WarrantManagerXml

public abstract class AbstractXmlAdapter
extends Object
implements XmlAdapter

Abstract class to provide basic error handling for XmlAdapter

Author:
Bob Jacobsen Copyright (c) 2009
See Also:
XmlAdapter

Constructor Summary
AbstractXmlAdapter()
           
 
Method Summary
 void creationErrorEncountered(Level level, String description, String systemName, String userName, Throwable exception)
          Provide common handling of errors that happen during the "load" process.
protected  ConfigXmlManager getConfigXmlManager()
           
 boolean loadDeferred()
          Determine if this set of configured objects should be loaded after basic GUI construction is completed.
 int loadOrder()
          Used for determining which order to load items from XML files in.
 void setConfigXmlManager(ConfigXmlManager c)
           
 
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, load, store
 

Constructor Detail

AbstractXmlAdapter

public AbstractXmlAdapter()
Method Detail

creationErrorEncountered

public void creationErrorEncountered(Level level,
                                     String description,
                                     String systemName,
                                     String userName,
                                     Throwable exception)
                              throws JmriConfigureXmlException
Provide common handling of errors that happen during the "load" process. Simple implementation just sends message to standard logging; needs to be given a plug-in structure for e.g. posting a Swing dialog, etc.

Specified by:
creationErrorEncountered in interface XmlAdapter
Parameters:
description - description of error encountered
systemName - System name of bean being handled, may be null
userName - used name of the bean being handled, may be null
exception - Any exception being handled in the processing, may be null
Throws:
JmriConfigureXmlException - in place for later expansion; should be propagated upward to higher-level error handling

loadDeferred

public boolean loadDeferred()
Determine if this set of configured objects should be loaded after basic GUI construction is completed.

Default behaviour is to load when requested. Classes that should wait until basic GUI is constructed should override this method and return true

Specified by:
loadDeferred in interface XmlAdapter
Returns:
true to defer loading
Since:
2.11.2
See Also:
XmlAdapter.loadDeferred()

loadOrder

public int loadOrder()
Used for determining which order to load items from XML files in.

Specified by:
loadOrder in interface XmlAdapter

setConfigXmlManager

public void setConfigXmlManager(ConfigXmlManager c)
Specified by:
setConfigXmlManager in interface XmlAdapter

getConfigXmlManager

protected ConfigXmlManager getConfigXmlManager()


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