Package org.tn5250j
Class GlobalConfigure
- java.lang.Object
-
- org.tn5250j.interfaces.ConfigureFactory
-
- org.tn5250j.GlobalConfigure
-
public class GlobalConfigure extends ConfigureFactory
Utility class for referencing global settings and functions of which at most one instance can exist per VM.Use GlobalConfigure.instance() to access this instance.
-
-
Field Summary
Fields Modifier and Type Field Description static java.io.Filesesstatic java.lang.StringTN5250J_FOLDER-
Fields inherited from class org.tn5250j.interfaces.ConfigureFactory
KEYMAP, MACROS, SESSIONS
-
-
Constructor Summary
Constructors Constructor Description GlobalConfigure()The constructor is made protected to allow overriding.
-
Method Summary
Modifier and Type Method Description java.lang.ClassLoadergetClassLoader()Not sure yet so be careful using this.java.util.PropertiesgetProperties()java.util.PropertiesgetProperties(java.lang.String regKey)Returns the properties associated with a given registry key.java.util.PropertiesgetProperties(java.lang.String regKey, java.lang.String fileName)java.util.PropertiesgetProperties(java.lang.String regKey, java.lang.String fileName, boolean createFile, java.lang.String header)java.util.PropertiesgetProperties(java.lang.String regKey, java.lang.String fileName, boolean createFile, java.lang.String header, boolean reloadIfLoaded)java.lang.StringgetProperty(java.lang.String key)Returns the setting from the given key of the global properties.java.lang.StringgetProperty(java.lang.String key, java.lang.String def)Returns the setting from the given key of the global properties or the default passed if the property does not exist.static GlobalConfigureinstance()voidreloadSettings()Reload the environment settings.voidsaveSettings()Save the settings for the global configurationvoidsaveSettings(java.lang.String regKey)Save the setting in the registry using the key passed in with no header output.voidsaveSettings(java.lang.String regKey, java.lang.String header)Save the settings in the registry using the key passed with a header in the output.voidsaveSettings(java.lang.String regKey, java.lang.String fileName, java.lang.String header)Save the settings in the registry using the key passed with a header in the output.voidsetProperties(java.lang.String regKey, java.lang.String fileName, java.lang.String header)Set the properties for the given registry key.voidsetProperties(java.lang.String regKey, java.lang.String fileName, java.lang.String header, boolean createFile)Set the properties for the given registry key.voidsetProperties(java.lang.String regKey, java.util.Properties regProps)Place the Properties in the registry under a given registry name-
Methods inherited from class org.tn5250j.interfaces.ConfigureFactory
getInstance
-
-
-
-
Field Detail
-
TN5250J_FOLDER
public static final java.lang.String TN5250J_FOLDER
- See Also:
- Constant Field Values
-
ses
public static final java.io.File ses
-
-
Method Detail
-
instance
public static GlobalConfigure instance()
- Returns:
- The unique instance of this class.
-
reloadSettings
public void reloadSettings()
Reload the environment settings.- Specified by:
reloadSettingsin classConfigureFactory
-
saveSettings
public void saveSettings()
Save the settings for the global configuration- Specified by:
saveSettingsin classConfigureFactory
-
saveSettings
public void saveSettings(java.lang.String regKey)
Save the setting in the registry using the key passed in with no header output.- Specified by:
saveSettingsin classConfigureFactory- Parameters:
regKey- registry key
-
saveSettings
public void saveSettings(java.lang.String regKey, java.lang.String header)Save the settings in the registry using the key passed with a header in the output.- Specified by:
saveSettingsin classConfigureFactory- Parameters:
regKey- registry keyheader- header
-
saveSettings
public void saveSettings(java.lang.String regKey, java.lang.String fileName, java.lang.String header)Save the settings in the registry using the key passed with a header in the output.- Specified by:
saveSettingsin classConfigureFactory- Parameters:
regKey- registry keyheader- header
-
setProperties
public void setProperties(java.lang.String regKey, java.util.Properties regProps)Place the Properties in the registry under a given registry name- Specified by:
setPropertiesin classConfigureFactory- Parameters:
regKey- registry keyregProps- properties
-
setProperties
public void setProperties(java.lang.String regKey, java.lang.String fileName, java.lang.String header)Set the properties for the given registry key.- Specified by:
setPropertiesin classConfigureFactory- Parameters:
regKey- registry keyfileName- a file nameheader- header
-
setProperties
public void setProperties(java.lang.String regKey, java.lang.String fileName, java.lang.String header, boolean createFile)Set the properties for the given registry key.- Specified by:
setPropertiesin classConfigureFactory- Parameters:
regKey- registry keyfileName- a file nameheader- headercreateFile- flag if settings should be saved
-
getProperties
public java.util.Properties getProperties(java.lang.String regKey)
Returns the properties associated with a given registry key.- Specified by:
getPropertiesin classConfigureFactory- Parameters:
regKey- registry key- Returns:
- properties
-
getProperties
public java.util.Properties getProperties()
-
getProperties
public java.util.Properties getProperties(java.lang.String regKey, java.lang.String fileName)- Specified by:
getPropertiesin classConfigureFactory
-
getProperties
public java.util.Properties getProperties(java.lang.String regKey, java.lang.String fileName, boolean createFile, java.lang.String header)- Specified by:
getPropertiesin classConfigureFactory
-
getProperties
public java.util.Properties getProperties(java.lang.String regKey, java.lang.String fileName, boolean createFile, java.lang.String header, boolean reloadIfLoaded)- Specified by:
getPropertiesin classConfigureFactory
-
getProperty
public java.lang.String getProperty(java.lang.String key, java.lang.String def)Returns the setting from the given key of the global properties or the default passed if the property does not exist.- Specified by:
getPropertyin classConfigureFactory- Parameters:
key- keydef- definition- Returns:
- a string
-
getProperty
public java.lang.String getProperty(java.lang.String key)
Returns the setting from the given key of the global properties.- Specified by:
getPropertyin classConfigureFactory- Parameters:
key- key- Returns:
- a string
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Not sure yet so be careful using this.- Returns:
- a class loader
-
-