java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
com.inductiveautomation.snap.web.Row
All Implemented Interfaces:
RMJSONArchiver.GetKeys, RMJSONArchiver.GetValue, RMJSONArchiver.SetValue, PropertyChangeListener, Serializable, Cloneable, EventListener, Map<String,Object>
Direct Known Subclasses:
SnapRow

Represents a data bearing object from a WebSite.
See Also:
  • Constructor Details

    • Row

      public Row()
  • Method Details

    • getSite

      public WebSite getSite()
      Returns the WebSite that created this row.
    • setSite

      protected void setSite(WebSite aSite)
      Sets the WebSite that created this row.
    • getEntity

      public Entity getEntity()
      Returns the entity that describes the data in this row.
    • setEntity

      public void setEntity(Entity anEntity)
      Sets the entity that describes the data in this row.
    • getProperty

      public Property getProperty(String aName)
      Returns the named property.
    • getPrimaryValue

      public Object getPrimaryValue()
      Returns the primary property.
    • initValues

      public void initValues(Map aMap)
      Initialize row values from map (or Entity default values).
    • get

      @Nullable public Object get(Object aKey)
      Returns the current row value for key. If key is a relation, return value as an Row or List <Row>>.
      Specified by:
      get in interface Map<String,Object>
      Overrides:
      get in class HashMap<String,Object>
    • get

      @Nullable public Object get(String aKey)
      Returns the current row value for key. If key is a relation, return value as a Row or List <Row>>.
    • get

      @Nullable public Object get(Property aProperty)
      Returns the current row value for key. If key is a relation, return value as a Row or List <Row>>.
    • getValue

      public Object getValue(String aKey)
      Returns the current row value for key.
    • getValue

      public Object getValue(Property aProperty)
      Returns the current row value for key.
    • getRaw

      protected Object getRaw(Property aProperty)
      Returns the current value or RowLink for a key.
    • put

      public Object put(String aKey, Object aValue)
      Put value by string.
      Specified by:
      put in interface Map<String,Object>
      Overrides:
      put in class HashMap<String,Object>
    • put

      public Object put(Property aProperty, Object anObj)
      Override put to do conversion.
    • getOriginal

      public Row getOriginal()
      Returns the original state of this row (or null if row not modified).
    • createOriginal

      protected Row createOriginal()
      Returns the row this row was loaded from or the original state of this row.
    • getUnresolvedRelationRows

      public Row[] getUnresolvedRelationRows()
      Returns an array of relation rows for this row that don't have a primary key value.
    • add

      public void add(String aKey, Row aRow, int anIndex)
      Adds an object to a list at given index.
    • add

      public void add(Property aProperty, Row aRow, int anIndex)
      Adds an object to a list at given index.
    • remove

      public Row remove(String aKey, int anIndex)
      Removes an object from a list at given index.
    • remove

      @Nullable public Row remove(Property aProperty, int anIndex)
      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

      public void propertyChange(PropertyChangeEvent anEvent)
      PropertyChangeListener method to propagate changes from row object to row.
      Specified by:
      propertyChange in interface PropertyChangeListener
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aListener)
      Add a property change listener.
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aListener)
      Remove a property change listener.
    • firePropertyChange

      protected void firePropertyChange(String aPropName, Object anOldVal, Object aNewVal, int anIndex)
      Fires a property change.
    • getJSONKeys

      public List<String> getJSONKeys()
      RMJSONArchiver method to return keys in property order and, potentially, NewValues key.
      Specified by:
      getJSONKeys in interface RMJSONArchiver.GetKeys
    • getJSONValue

      public Object getJSONValue(String aKey)
      RMJSONArchiver method to get archiver values via getValue() and handle NewValues.
      Specified by:
      getJSONValue in interface RMJSONArchiver.GetValue
    • setJSONValue

      public void setJSONValue(String aKey, Object aValue)
      RMJSONArchiver method to put archiver values and handle NewValues.
      Specified by:
      setJSONValue in interface RMJSONArchiver.SetValue
    • equals

      public boolean equals(Object anObj)
      Override to just check identity, since rows are unique.
      Specified by:
      equals in interface Map<String,Object>
      Overrides:
      equals in class AbstractMap<String,Object>
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class AbstractMap<String,Object>