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 TypeMethodDescriptionvoidaddListItem(String aKey, Object aValue) Adds a list item.voidaddListItem(String aKey, Object aValue, int anIndex) Adds a list item at given index.protected voidfirePropertyChange(String aName, Object oldVal, Object newVal, int anIndex) Override to forward to parents if present.static SettingsReturns the settings for given file.Returns a value.<T> TReturns a value of a given class.Returns a value.booleangetBoolValue(String aKey) Returns an bool value.booleangetBoolValue(String aKey, boolean aDefault) Returns an bool value.getFile()Returns the source file.floatgetFloatValue(String aKey) Returns a float value.floatgetFloatValue(String aKey, float aDefault) Returns a float value.intgetIntValue(String aKey) Returns an int value.intgetIntValue(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.voidSets a value.removeListItem(String aKey, int anIndex) Removes a list item at given index.intremoveListItem(String aKey, Object aValue) Removes a list item at given index.voidsetJSONValue(String aKey, Object aValue) Returns a list of keys to be uses to retrieve persistent attributes from an object.booleansetKeyValue(String aKey, Object aValue) protected ObjectSets a value for a simple key without firing property change.toString()Standard toString implementation.voidupdateFile(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.GetClassReturns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
getJSONClassin interfaceRMJSONArchiver.GetClass
-
setJSONValue
Description copied from interface:RMJSONArchiver.SetValueReturns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
setJSONValuein interfaceRMJSONArchiver.SetValue
-
getJSONValue
Description copied from interface:RMJSONArchiver.GetValueReturns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
getJSONValuein interfaceRMJSONArchiver.GetValue
-
getJSONKeys
Description copied from interface:RMJSONArchiver.GetKeysReturns a list of keys to be uses to retrieve persistent attributes from an object.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
getKeyValue
- Specified by:
getKeyValuein interfaceRMKey.Get
-
setKeyValue
- Specified by:
setKeyValuein interfaceRMKey.GetSet
-
toString
Standard toString implementation. -
updateFile
Saves the file.- Specified by:
updateFilein interfaceWebFile.Updater
-
get
Returns the settings for given file.
-