Package com.inductiveautomation.snap.web
Class Settings
java.lang.Object
com.inductiveautomation.snap.web.Settings
- All Implemented Interfaces:
RMJSONArchiver.GetClass
,RMJSONArchiver.GetKeys
,RMJSONArchiver.GetValue
,RMJSONArchiver.SetValue
,RMKey.Get
,RMKey.GetSet
,WebFile.Updater
public class Settings
extends Object
implements RMJSONArchiver.GetKeys, RMJSONArchiver.GetValue, RMJSONArchiver.SetValue, RMJSONArchiver.GetClass, RMKey.GetSet, WebFile.Updater
An object to get, set and store site settings.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListItem
(String aKey, Object aValue) Adds a list item.void
addListItem
(String aKey, Object aValue, int anIndex) Adds a list item at given index.protected void
firePropertyChange
(String aName, Object oldVal, Object newVal, int anIndex) Override to forward to parents if present.static Settings
Returns the settings for given file.Returns a value.<T> T
Returns a value of a given class.Returns a value.boolean
getBoolValue
(String aKey) Returns an bool value.boolean
getBoolValue
(String aKey, boolean aDefault) Returns an bool value.getFile()
Returns the source file.float
getFloatValue
(String aKey) Returns a float value.float
getFloatValue
(String aKey, float aDefault) Returns a float value.int
getIntValue
(String aKey) Returns an int value.int
getIntValue
(String aKey, int aDefault) Returns an int value.Returns a list of keys to be uses to retrieve persistent attributes from an object.Returns a list of keys to be uses to retrieve persistent attributes from an object.getJSONValue
(String aKey) Returns a list of keys to be uses to retrieve persistent attributes from an object.getKeyValue
(String aKey) Returns a List value.Returns a List value, with option to create if missing.getSettings
(String aKey) Returns the settings for key.getSettings
(String aKey, boolean doCreate) Returns the settings for key, with option to create if missing.getStringValue
(String aKey) Returns as a String value.getStringValue
(String aKey, String aDefault) Returns as a String value.void
Sets a value.removeListItem
(String aKey, int anIndex) Removes a list item at given index.int
removeListItem
(String aKey, Object aValue) Removes a list item at given index.void
setJSONValue
(String aKey, Object aValue) Returns a list of keys to be uses to retrieve persistent attributes from an object.boolean
setKeyValue
(String aKey, Object aValue) protected Object
Sets a value for a simple key without firing property change.toString()
Standard toString implementation.void
updateFile
(WebFile aFile) Saves the file.
-
Constructor Details
-
Settings
public Settings()Creates new Settings. -
Settings
Creates a new Settings from a byte source.
-
-
Method Details
-
getFile
Returns the source file. -
get
Returns a value. -
get
Returns a value. -
get
Returns a value of a given class. -
put
Sets a value. -
simplePut
Sets a value for a simple key without firing property change. -
getStringValue
Returns as a String value. -
getStringValue
Returns as a String value. -
getBoolValue
Returns an bool value. -
getBoolValue
Returns an bool value. -
getIntValue
Returns an int value. -
getIntValue
Returns an int value. -
getFloatValue
Returns a float value. -
getFloatValue
Returns a float value. -
getList
Returns a List value. -
getList
Returns a List value, with option to create if missing. -
addListItem
Adds a list item. -
addListItem
Adds a list item at given index. -
removeListItem
Removes a list item at given index. -
removeListItem
Removes a list item at given index. -
getSettings
Returns the settings for key. -
getSettings
Returns the settings for key, with option to create if missing. -
firePropertyChange
Override to forward to parents if present. -
getJSONClass
Description copied from interface:RMJSONArchiver.GetClass
Returns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
getJSONClass
in interfaceRMJSONArchiver.GetClass
-
setJSONValue
Description copied from interface:RMJSONArchiver.SetValue
Returns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
setJSONValue
in interfaceRMJSONArchiver.SetValue
-
getJSONValue
Description copied from interface:RMJSONArchiver.GetValue
Returns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
getJSONValue
in interfaceRMJSONArchiver.GetValue
-
getJSONKeys
Description copied from interface:RMJSONArchiver.GetKeys
Returns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
getKeyValue
- Specified by:
getKeyValue
in interfaceRMKey.Get
-
setKeyValue
- Specified by:
setKeyValue
in interfaceRMKey.GetSet
-
toString
Standard toString implementation. -
updateFile
Saves the file.- Specified by:
updateFile
in interfaceWebFile.Updater
-
get
Returns the settings for given file.
-