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 changeA 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()
andisDirty(String)
methods.The data model can be modified only through the set methods:
This is ensuring the dirty state will be correctly updatedThis 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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Object
getData(String key)
Deprecated.Gets the named field value.Collection<String>
getDirtyFields()
Deprecated.Gets the collection of the dirty fields in this data model.Map<String,Object>
getMap()
Deprecated.Gets all the fields set in this data model.String
getSchema()
Deprecated.Gets the schema of this data model.Object
getValue(String path)
Deprecated.Gets a value given its path.boolean
isDirty()
Deprecated.Tests whether or not this data model is dirty (i.e.boolean
isDirty(String name)
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
setDirty(String name)
Deprecated.Marks the specified field from this data model as dirty.void
setMap(Map<String,Object> data)
Deprecated.Sets several field at once.Object
setValue(String path, Object value)
Deprecated.Sets a value to a property given its path.
-
-
-
Method Detail
-
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 namevalue
- 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
Map<String,Object> getMap() throws PropertyException
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
-
-