Package com.inductiveautomation.snap.web
Class Row
- All Implemented Interfaces:
RMJSONArchiver.GetKeys
,RMJSONArchiver.GetValue
,RMJSONArchiver.SetValue
,PropertyChangeListener
,Serializable
,Cloneable
,EventListener
,Map<String,
Object>
- Direct Known Subclasses:
SnapRow
public class Row
extends HashMap<String,Object>
implements PropertyChangeListener, RMJSONArchiver.GetKeys, RMJSONArchiver.GetValue, RMJSONArchiver.SetValue
Represents a data bearing object from a WebSite.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an object to a list at given index.void
Adds an object to a list at given index.void
addPropertyChangeListener
(PropertyChangeListener aListener) Add a property change listener.protected Row
Returns the row this row was loaded from or the original state of this row.void
delete()
Deletes this row.boolean
Override to just check identity, since rows are unique.protected void
firePropertyChange
(String aPropName, Object anOldVal, Object aNewVal, int anIndex) Fires a property change.Returns the current row value for key.Returns the current row value for key.Returns the current row value for key.Returns the entity that describes the data in this row.boolean
Returns whether file exists in data source (has been saved and, if so, not deleted).RMJSONArchiver method to return keys in property order and, potentially, NewValues key.getJSONValue
(String aKey) RMJSONArchiver method to get archiver values via getValue() and handle NewValues.long
Returns the file modification time.Returns the original state of this row (or null if row not modified).Returns the primary property.getProperty
(String aName) Returns the named property.protected Object
Returns the current value or RowLink for a key.getSite()
Returns the WebSite that created this row.Row[]
Returns an array of relation rows for this row that don't have a primary key value.Returns the current row value for key.Returns the current row value for key.void
initValues
(Map aMap) Initialize row values from map (or Entity default values).boolean
Returns whether this row's row object has been changed.void
propertyChange
(PropertyChangeEvent anEvent) PropertyChangeListener method to propagate changes from row object to row.Override put to do conversion.Put value by string.Removes an object from list at given index.Removes an object from a list at given index.void
Remove a property change listener.void
save()
Saves this row.void
Sets the entity that describes the data in this row.protected void
setExists
(boolean aFlag) Sets whether file exists in data source (has been saved and, if so, not deleted).void
setJSONValue
(String aKey, Object aValue) RMJSONArchiver method to put archiver values and handle NewValues.protected void
setModified
(boolean aValue) Sets whether this row's row object has been changed.void
setModifiedTime
(long aTime) Sets the file modification time.protected void
Sets the WebSite that created this row.toString()
Standard toString implementation.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
hashCode
-
Constructor Details
-
Row
public Row()
-
-
Method Details
-
getSite
Returns the WebSite that created this row. -
setSite
Sets the WebSite that created this row. -
getEntity
Returns the entity that describes the data in this row. -
setEntity
Sets the entity that describes the data in this row. -
getProperty
Returns the named property. -
getPrimaryValue
Returns the primary property. -
initValues
Initialize row values from map (or Entity default values). -
get
Returns the current row value for key. If key is a relation, return value as an Row or List <Row>>. -
get
Returns the current row value for key. If key is a relation, return value as a Row or List <Row>>. -
get
Returns the current row value for key. If key is a relation, return value as a Row or List <Row>>. -
getValue
Returns the current row value for key. -
getValue
Returns the current row value for key. -
getRaw
Returns the current value or RowLink for a key. -
put
Put value by string. -
put
Override put to do conversion. -
getOriginal
Returns the original state of this row (or null if row not modified). -
createOriginal
Returns the row this row was loaded from or the original state of this row. -
getUnresolvedRelationRows
Returns an array of relation rows for this row that don't have a primary key value. -
add
Adds an object to a list at given index. -
add
Adds an object to a list at given index. -
remove
Removes an object from a list at given index. -
remove
Removes an object from list at given index. -
getExists
public boolean getExists()Returns whether file exists in data source (has been saved and, if so, not deleted). -
setExists
protected void setExists(boolean aFlag) Sets whether file exists in data source (has been saved and, if so, not deleted). -
getModifiedTime
public long getModifiedTime()Returns the file modification time. -
setModifiedTime
public void setModifiedTime(long aTime) Sets the file modification time. -
isModified
public boolean isModified()Returns whether this row's row object has been changed. -
setModified
protected void setModified(boolean aValue) Sets whether this row's row object has been changed. -
save
public void save()Saves this row. -
delete
public void delete()Deletes this row. -
propertyChange
PropertyChangeListener method to propagate changes from row object to row.- Specified by:
propertyChange
in interfacePropertyChangeListener
-
addPropertyChangeListener
Add a property change listener. -
removePropertyChangeListener
Remove a property change listener. -
firePropertyChange
Fires a property change. -
getJSONKeys
RMJSONArchiver method to return keys in property order and, potentially, NewValues key.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
getJSONValue
RMJSONArchiver method to get archiver values via getValue() and handle NewValues.- Specified by:
getJSONValue
in interfaceRMJSONArchiver.GetValue
-
setJSONValue
RMJSONArchiver method to put archiver values and handle NewValues.- Specified by:
setJSONValue
in interfaceRMJSONArchiver.SetValue
-
equals
Override to just check identity, since rows are unique. -
toString
Standard toString implementation.- Overrides:
toString
in classAbstractMap<String,
Object>
-