Package jmri.jmrit

Class XmlFile

java.lang.Object
jmri.jmrit.XmlFile
Direct Known Subclasses:
AbstractWiThrottlePreferences.AbstractWiThrottlePreferencesXml, BlockValueFile, CbusEventTableXmlFile, CbusNodeBackupFile, ConfigXmlManager, ConsistFile, DecoderFile, DecoderIndexFile, DefaultCatalogTreeManagerXml, DefaultIdTagManagerXml, DefaultSignalSystemManager.AspectFile, ExportCars, ExportEngines, ExportLocations, ExportRoutes, ExportSchedules, ExportTimetable, ExportTrainLineups, ExportTrains, LoadXmlThrottlesLayoutAction.ThrottlePrefs, LocoFile, NameFile, NceConsistRoster, OperationsXml, OptionsFile, PollingFile, PositionFile, RollingStockLogger, Roster, ThrottlesPreferences.ThrottlesPrefsXml, TimeTableXml.TimeTableXmlFile, TrainInfoFile, TrainLogger, VSDecoderPreferences.VSDecoderPrefsXml, VSDGeoFile, WarrantPreferences.WarrantPreferencesXml

public abstract class XmlFile
extends Object
Handle common aspects of XML files.

JMRI needs to be able to operate offline, so it needs to store resources locally. At the same time, we want XML files to be transportable, and to have their schema and stylesheets accessible via the web (for browser rendering). Further, our code assumes that default values for attributes will be provided, and it's necessary to read the schema for that to work.

We implement this using our own EntityResolver, the JmriLocalEntityResolver class.

When reading a file, validation is controlled heirarchically:

  • There's a global default
  • Which can be overridden on a particular XmlFile object
  • Finally, the static call to create a builder can be invoked with a validation specification.