jindent
Class JindentSettings

java.lang.Object
  extended by jindent.Settings
      extended by jindent.JindentSettings
All Implemented Interfaces:
Serializable, Cloneable, jindent.settings.VersionInfo

public class JindentSettings
extends Settings
implements jindent.settings.VersionInfo

This class contains the Jindent settings. Settings control the formatter modules and can be configured through Jindent's customizer interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jindent.settings.VersionInfo
UNKNOW_VERSION
 
Constructor Summary
JindentSettings()
          Constructs empty JindentSettings.
JindentSettings(HashMap settingsMap)
          Constructs JindentSettings from a HashMap.
 
Method Summary
 Object clone()
           
static Settings createFromFile(String filename)
          Creates JindentSettings from xml file.
static JindentSettings createFromFileAndCheckVersion(String filename)
           
static Settings createFromResource(String filename)
          Creates JindentSettings from xml resource file.
 ExtensionManager getExtensionManager()
           
 float getVersion()
          Gets version of Jindent's setting format.
 void writeToFile(String filename)
          Writes JindentSettings to an xml file.
 
Methods inherited from class jindent.Settings
countSettings, getAbsoluteRelativeIndex, getBAWrappingIndex, getBoolean, getBracesSetting, getDateFormat, getEncoding, getEndOfLineFormat, getExtensionManager, getFloat, getFooterIndex, getHeaderIndex, getMessageReportIndex, getNumber, getPositionIndex, getSetting, getSettingsMap, getSorterElement, getString, getStringArray, getUserVariablesSetting, getWrappingIndex, isDefaultEncoding, isInfiniteINumber, keysIterator, putSetting, removeAllSettings, removeSetting, setAbsoluteRelativeIndex, setBAWrappingIndex, setBoolean, setDateFormat, setEncoding, setFloat, setFooterIndex, setHeaderIndex, setInfiniteINumber, setINumber, setNumber, setPositionIndex, setSettingsMap, setString, setStringArray, setStringArray, settingsIterator, setWrappingIndex, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JindentSettings

public JindentSettings()
Constructs empty JindentSettings.
Please note:This does not construct the Jindent default settings! To get Jindent's default settings see JindentSystem.getDefaultJindentSettings().


JindentSettings

public JindentSettings(HashMap settingsMap)
Constructs JindentSettings from a HashMap.

Parameters:
settingsMap - input HashMap
Method Detail

getVersion

public float getVersion()
Gets version of Jindent's setting format.

Specified by:
getVersion in interface jindent.settings.VersionInfo
Returns:
version

writeToFile

public void writeToFile(String filename)
                 throws JindentException
Writes JindentSettings to an xml file.

Overrides:
writeToFile in class Settings
Parameters:
filename - filename of destination file
Throws:
JindentException - if anything went wrong while writing

createFromResource

public static Settings createFromResource(String filename)
                                   throws JindentException,
                                          FileNotFoundException
Creates JindentSettings from xml resource file. (Useful if you need to read settings files from inside a jar file.)

Parameters:
filename - filename of JindentSettings file
Returns:
JindentSettings created from input file
Throws:
JindentException - if anything went wrong while reading
FileNotFoundException

createFromFile

public static Settings createFromFile(String filename)
                               throws JindentException,
                                      FileNotFoundException
Creates JindentSettings from xml file.

Parameters:
filename - filename of JindentSettings file
Returns:
JindentSettings created from input file
Throws:
JindentException - if anything went wrong while reading
FileNotFoundException

createFromFileAndCheckVersion

public static JindentSettings createFromFileAndCheckVersion(String filename)
                                                     throws JindentException,
                                                            FileNotFoundException,
                                                            SettingsVersionException
Throws:
JindentException
FileNotFoundException
SettingsVersionException

clone

public Object clone()
Overrides:
clone in class Settings

getExtensionManager

public ExtensionManager getExtensionManager()