Class CarManagerXml
- java.lang.Object
-
- jmri.jmrit.XmlFile
-
- jmri.jmrit.operations.OperationsXml
-
- jmri.jmrit.operations.rollingstock.cars.CarManagerXml
-
- All Implemented Interfaces:
InstanceManagerAutoDefault
,InstanceManagerAutoInitialize
public class CarManagerXml extends OperationsXml implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize
Loads and stores cars using xml files. Also loads and stores car road names, car types, car colors, car lengths, car owners, and car kernels.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.XmlFile
XmlFile.Validate
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
CAR_ROUTER_REPORTS
(package private) static java.lang.String
CAR_ROUTER_REPORTS_RAW
-
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
-
-
Constructor Summary
Constructors Constructor Description CarManagerXml()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
createCarRouterReportFile(java.lang.String name)
java.io.File
createRawCarRouterReportFile(java.lang.String name)
java.lang.String
defaultCarRouterReportFileName(java.lang.String name)
java.lang.String
defaultRawCarRouterReportFileName(java.lang.String name)
void
dispose()
java.io.File
getCarRouterReportFile(java.lang.String name)
java.lang.String
getOperationsFileName()
java.io.File
getRawCarRouterReportFile(java.lang.String name)
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
-
-
-
-
Field Detail
-
CAR_ROUTER_REPORTS
static final java.lang.String CAR_ROUTER_REPORTS
- See Also:
- Constant Field Values
-
CAR_ROUTER_REPORTS_RAW
static final java.lang.String CAR_ROUTER_REPORTS_RAW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CarManagerXml
public CarManagerXml()
-
-
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
-
createCarRouterReportFile
public java.io.File createCarRouterReportFile(java.lang.String name)
-
getCarRouterReportFile
public java.io.File getCarRouterReportFile(java.lang.String name)
-
defaultCarRouterReportFileName
public java.lang.String defaultCarRouterReportFileName(java.lang.String name)
-
createRawCarRouterReportFile
public java.io.File createRawCarRouterReportFile(java.lang.String name)
-
getRawCarRouterReportFile
public java.io.File getRawCarRouterReportFile(java.lang.String name)
-
defaultRawCarRouterReportFileName
public java.lang.String defaultRawCarRouterReportFileName(java.lang.String name)
-
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
-
-