Class EngineManagerXml
- java.lang.Object
-
- jmri.jmrit.XmlFile
-
- jmri.jmrit.operations.OperationsXml
-
- jmri.jmrit.operations.rollingstock.engines.EngineManagerXml
-
- All Implemented Interfaces:
InstanceManagerAutoDefault
,InstanceManagerAutoInitialize
public class EngineManagerXml extends OperationsXml implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize
Loads and stores engines using xml files. Also loads and stores engine models, engine types, engine lengths, and engine consist names.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.XmlFile
XmlFile.Validate
-
-
Field Summary
-
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
-
-
Constructor Summary
Constructors Constructor Description EngineManagerXml()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
java.lang.String
getOperationsFileName()
void
initialize()
Perform any initialization that occurs after this object has been constructed and made available by the InstanceManager.void
readFile(java.lang.String name)
Read the contents of a roster XML file into this object.void
setOperationsFileName(java.lang.String name)
void
writeFile(java.lang.String name)
-
Methods inherited from class jmri.jmrit.operations.OperationsXml
areFilesDirty, checkFileName, createFile, getDefaultOperationsFilename, getFileLocation, getOperationsDirectoryName, isDirty, load, save, setDirty, setFileLocation, setOperationsDirectoryName, writeFileIfDirty, writeOperationsFile
-
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, findFile, getBuilder, getDefaultDtdLocation, getDefaultValidate, getDtdLocation, getProcessingInstructionHRef, getProcessingInstructionType, getRoot, getValidate, makeBackupFile, makeBackupFile, newDocument, newDocument, revertBackupFile, rootFromFile, rootFromInputStream, rootFromName, rootFromURL, setDefaultDtdLocation, setDefaultValidate, setDtdLocation, setValidate, userFileChooser, userFileChooser, writeXML, xmlDir
-
-
-
-
Constructor Detail
-
EngineManagerXml
public EngineManagerXml()
-
-
Method Detail
-
writeFile
public void writeFile(java.lang.String name) throws java.io.FileNotFoundException, java.io.IOException
- Overrides:
writeFile
in classOperationsXml
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
readFile
public void readFile(java.lang.String name) throws org.jdom2.JDOMException, java.io.IOException
Read the contents of a roster XML file into this object. Note that this does not clear any existing entries.- Specified by:
readFile
in classOperationsXml
- Parameters:
name
- The string file name.- Throws:
org.jdom2.JDOMException
- Due to XML parsing errorjava.io.IOException
- Due to trouble accessing named file
-
setOperationsFileName
public void setOperationsFileName(java.lang.String name)
- Overrides:
setOperationsFileName
in classOperationsXml
-
getOperationsFileName
public java.lang.String getOperationsFileName()
- Overrides:
getOperationsFileName
in classOperationsXml
-
dispose
public void dispose()
-
initialize
public void initialize()
Description copied from interface:InstanceManagerAutoInitialize
Perform any initialization that occurs after this object has been constructed and made available by the InstanceManager.- Specified by:
initialize
in interfaceInstanceManagerAutoInitialize
-
-