Interface DataModel
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DataModelImpl
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
.
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the named field value.Deprecated.Gets the collection of the dirty fields in this data model.getMap()
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
isDirty()
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
Deprecated.Sets the name field.void
Deprecated.Marks the specified field from this data model as dirty.void
Deprecated.Sets several field at once.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
Deprecated.Sets the name field.- Parameters:
key
- the field namevalue
- the value to set. Accept null values.- Throws:
PropertyException
-
getData
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
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
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
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
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
Deprecated.Sets a value to a property given its path.- Throws:
PropertyException
-