Interface DataModel

All Superinterfaces:
Serializable
All Known Implementing Classes:
DataModelImpl

@Deprecated public interface DataModel extends Serializable
Deprecated.
since 8.4 for public use, this is an internal implementation class subject to change
A data model is a concrete representation of a schema.

The schema describe the data structure and the data model object is storing concrete values according to that structure.

When the user modifies a data structure the modified fields are tracked so that at any time you can query about the dirty state of the data model by using the isDirty() and isDirty(String) methods.

The data model can be modified only through the set methods:

This is ensuring the dirty state will be correctly updated

This is the reason why the getMap() method is returning a read only map.

Data structure are usually part of a composite model as the DocumentModel.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Gets the named field value.
    Deprecated.
    Gets the collection of the dirty fields in this data model.
    Deprecated.
    Gets all the fields set in this data model.
    Deprecated.
    Gets the schema of this data model.
    Deprecated.
    Gets a value given its path.
    boolean
    Deprecated.
    Tests whether or not this data model is dirty (i.e. it was changed by the client).
    boolean
    Deprecated.
    Tests whether or not the specified field from this data model is dirty.
    void
    setData(String key, Object value)
    Deprecated.
    Sets the name field.
    void
    Deprecated.
    Marks the specified field from this data model as dirty.
    void
    Deprecated.
    Sets several field at once.
    setValue(String path, Object value)
    Deprecated.
    Sets a value to a property given its path.
  • Method Details

    • getSchema

      String getSchema()
      Deprecated.
      Gets the schema of this data model.
      Returns:
      the data model schema
    • setData

      void setData(String key, Object value) throws PropertyException
      Deprecated.
      Sets the name field.
      Parameters:
      key - the field name
      value - the value to set. Accept null values.
      Throws:
      PropertyException
    • getData

      Object getData(String key) throws PropertyException
      Deprecated.
      Gets the named field value.
      Parameters:
      key - the field key
      Returns:
      the value or null if no such field exists
      Throws:
      PropertyException
    • getMap

      Deprecated.
      Gets all the fields set in this data model.

      It is not guaranteed that the returned map will contain all the fields defined by the schema. It may even be empty.

      The returned map is null if the data model was not yet loaded.

      Returns:
      a read only map containing actual data in this object
      Throws:
      PropertyException
    • setMap

      void setMap(Map<String,Object> data) throws PropertyException
      Deprecated.
      Sets several field at once.
      Parameters:
      data - the fields to set as a map
      Throws:
      PropertyException
    • isDirty

      boolean isDirty()
      Deprecated.
      Tests whether or not this data model is dirty (i.e. it was changed by the client).
      Returns:
      true if the data model is dirty, false otherwise
    • isDirty

      boolean isDirty(String name) throws PropertyNotFoundException
      Deprecated.
      Tests whether or not the specified field from this data model is dirty.
      Parameters:
      name - the field name to tests
      Returns:
      true if the field is dirty, false otherwise
      Throws:
      PropertyNotFoundException
    • setDirty

      void setDirty(String name) throws PropertyNotFoundException
      Deprecated.
      Marks the specified field from this data model as dirty.
      Parameters:
      name - the field name to be dirty
      Throws:
      PropertyNotFoundException
    • getDirtyFields

      Collection<String> getDirtyFields()
      Deprecated.
      Gets the collection of the dirty fields in this data model.
      Returns:
      the dirty fields or null if there are no dirty fields
    • getValue

      Object getValue(String path) throws PropertyException
      Deprecated.
      Gets a value given its path.

      The path is a subset of XPath: / and [] are supported.

      Parameters:
      path - the property path
      Throws:
      PropertyException
    • setValue

      Object setValue(String path, Object value) throws PropertyException
      Deprecated.
      Sets a value to a property given its path.
      Throws:
      PropertyException