java.lang.Object
org.gjt.sp.jedit.SettingsXML
A XML file in the settings directory.
This class provides some common operations to load/save settings
from/into a XML file.
- Proper encoding and XML declaration.
- Two stage save.
- Making backup on each save.
- Detection of change on disk.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionSettingsXML
(File f) SettingsXML
(String settingsDirectory, String name) Construct a SettingsXML with specific location and name. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the file exists.boolean
Returns true if the file has been changed on disk.void
load
(DefaultHandler handler) Parse the XML file to load.Open the file to save in XML.toString()
Returns the file's path.
-
Constructor Details
-
SettingsXML
Construct a SettingsXML with specific location and name.- Parameters:
settingsDirectory
- The settings directory of jeditname
- The file name will be (name + ".xml")
-
SettingsXML
-
-
Method Details
-
fileExists
public boolean fileExists()Returns true if the file exists. -
load
Parse the XML file to load.- Parameters:
handler
- The handler to receive SAX notifications.- Throws:
IOException
-
openSaver
Open the file to save in XML.- Throws:
IOException
-
hasChangedOnDisk
public boolean hasChangedOnDisk()Returns true if the file has been changed on disk. This is based on the last modified time at the last saving or loading. -
toString
Returns the file's path.
-