Package org.nuxeo.ecm.core.api.impl
Class DataModelImpl
java.lang.Object
org.nuxeo.ecm.core.api.impl.DataModelImpl
- All Implemented Interfaces:
Serializable,DataModel
Data model implementation.
- Author:
- Bogdan Stefanescu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDataModelImpl(String schema) Builds an empty data model.DataModelImpl(String schemaName, Map<String, Object> data) Builds a data model using the given data.DataModelImpl(DocumentPart part) -
Method Summary
Modifier and TypeMethodDescriptionGets the named field value.Gets the collection of the dirty fields in this data model.Gets the underlying document part.getMap()Gets all the fields set in this data model.Gets the schema of this data model.Gets a value given its path.booleanisDirty()Tests whether or not this data model is dirty (i.e. it was changed by the client).booleanTests whether or not the specified field from this data model is dirty.voidSets the name field.voidMarks the specified field from this data model as dirty.voidSets several field at once.Sets a value to a property given its path.toString()
-
Constructor Details
-
DataModelImpl
Builds an empty data model.- Parameters:
schema- a schema name.
-
DataModelImpl
Builds a data model using the given data.- Parameters:
schemaName- a schema name.data- the data (map String>Object) to put in the DataModel.
-
DataModelImpl
-
-
Method Details
-
getDocumentPart
Gets the underlying document part. -
getSchema
Description copied from interface:DataModelGets the schema of this data model. -
getData
Description copied from interface:DataModelGets the named field value.- Specified by:
getDatain interfaceDataModel- Parameters:
key- the field key- Returns:
- the value or null if no such field exists
- Throws:
PropertyException
-
setData
Description copied from interface:DataModelSets the name field.- Specified by:
setDatain interfaceDataModel- Parameters:
key- the field namevalue- the value to set. Accept null values.- Throws:
PropertyException
-
getMap
Description copied from interface:DataModelGets 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.
- Specified by:
getMapin interfaceDataModel- Returns:
- a read only map containing actual data in this object
- Throws:
PropertyException
-
setMap
Description copied from interface:DataModelSets several field at once.- Specified by:
setMapin interfaceDataModel- Parameters:
data- the fields to set as a map- Throws:
PropertyException
-
isDirty
public boolean isDirty()Description copied from interface:DataModelTests whether or not this data model is dirty (i.e. it was changed by the client). -
isDirty
Description copied from interface:DataModelTests whether or not the specified field from this data model is dirty.- Specified by:
isDirtyin interfaceDataModel- Parameters:
name- the field name to tests- Returns:
- true if the field is dirty, false otherwise
- Throws:
PropertyNotFoundException
-
getDirtyFields
Description copied from interface:DataModelGets the collection of the dirty fields in this data model.- Specified by:
getDirtyFieldsin interfaceDataModel- Returns:
- the dirty fields or null if there are no dirty fields
-
toString
-
setDirty
Description copied from interface:DataModelMarks the specified field from this data model as dirty.- Specified by:
setDirtyin interfaceDataModel- Parameters:
name- the field name to be dirty- Throws:
PropertyNotFoundException
-
getValue
Description copied from interface:DataModelGets a value given its path.The path is a subset of XPath: / and [] are supported.
- Specified by:
getValuein interfaceDataModel- Parameters:
path- the property path- Throws:
PropertyException
-
setValue
Description copied from interface:DataModelSets a value to a property given its path.- Specified by:
setValuein interfaceDataModel- Throws:
PropertyException
-