Module jEdit

Class SettingsXML

java.lang.Object
org.gjt.sp.jedit.SettingsXML

public class SettingsXML extends Object
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.
  • Constructor Details

    • SettingsXML

      public SettingsXML(String settingsDirectory, String name)
      Construct a SettingsXML with specific location and name.
      Parameters:
      settingsDirectory - The settings directory of jedit
      name - The file name will be (name + ".xml")
    • SettingsXML

      public SettingsXML(File f)
  • Method Details

    • fileExists

      public boolean fileExists()
      Returns true if the file exists.
    • load

      public void load(DefaultHandler handler) throws IOException
      Parse the XML file to load.
      Parameters:
      handler - The handler to receive SAX notifications.
      Throws:
      IOException
    • openSaver

      public SettingsXML.Saver openSaver() throws IOException
      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

      public String toString()
      Returns the file's path.
      Overrides:
      toString in class Object