Package jmri.jmrit.operations
Class OperationsXml
java.lang.Object
jmri.jmrit.XmlFile
jmri.jmrit.operations.OperationsXml
- Direct Known Subclasses:
CarManagerXml,EngineManagerXml,LocationManagerXml,OperationsSetupXml,RouteManagerXml,TrainManagerXml
Loads and stores the operation setup using xml files.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks to see if any operations files are dirtystatic booleancheckFileName(String name) Checks name for the file control characters:protected FilecreateFile(String fullPathName, boolean backupFile) static StringAbsolute path to location of Operations files.static StringbooleanisDirty()protected voidload()abstract voidstatic voidsave()Saves operation files that have been modified.voidsetDirty(boolean b) static voidsetFileLocation(String location) Set path to location of Operations files.static voidvoidsetOperationsFileName(String name) protected voidvoidvoidStore the all of the operation train objects in the default place, including making a backup if neededMethods 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 Details
-
OperationsXml
public OperationsXml()
-
-
Method Details
-
writeOperationsFile
Store the all of the operation train objects in the default place, including making a backup if needed -
load
-
createFile
-
writeFile
- Throws:
FileNotFoundExceptionIOException
-
readFile
- Parameters:
filename- The string file name.- Throws:
org.jdom2.JDOMException- Due to XML parsing errorIOException- Due to trouble accessing named file
-
setDirty
-
isDirty
-
writeFileIfDirty
-
getDefaultOperationsFilename
-
setOperationsDirectoryName
-
getOperationsDirectoryName
-
setOperationsFileName
-
getOperationsFileName
-
getFileLocation
Absolute path to location of Operations files.Default is in the user's files path, but can be set to anything.
- Returns:
- The string path name.
- See Also:
-
setFileLocation
Set path to location of Operations files.Default is in the user's files path, but can be set to anything.
- Parameters:
location- path to file, including trailing file separator.
-
checkFileName
Checks name for the file control characters:- Parameters:
name- The string to check for a valid file name.- Returns:
- true if name is okay, false if name contains a control character.
-
save
Saves operation files that have been modified. -
areFilesDirty
Checks to see if any operations files are dirty- Returns:
- True if any operations parameters have been modified.
-