public static class SimpleDocumentModel.SimpleDataModel extends Object implements DataModel
| Constructor and Description |
|---|
SimpleDocumentModel.SimpleDataModel(String schema) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getData(String key)
Gets the named field value.
|
Collection<String> |
getDirtyFields()
Gets the collection of the dirty fields in this data model.
|
Map<String,Object> |
getMap()
Gets all the fields set in this data model.
|
String |
getSchema()
Gets the schema of this data model.
|
Object |
getValue(String path)
Gets a value given its path.
|
boolean |
isDirty()
Tests whether or not this data model is dirty
(i.e.
|
boolean |
isDirty(String name)
Tests whether or not the specified field from this data model
is dirty.
|
void |
setData(String key,
Object value)
Sets the name field.
|
void |
setDirty(String name)
Marks the specified field from this data model
as dirty.
|
void |
setMap(Map<String,Object> data)
Sets several field at once.
|
Object |
setValue(String path,
Object value)
Sets a value to a property given its path.
|
public SimpleDocumentModel.SimpleDataModel(String schema)
public void setData(String key, Object value) throws PropertyException
DataModelsetData in interface DataModelkey - the field namevalue - the value to set. Accept null values.PropertyExceptionpublic Object getData(String key) throws PropertyException
DataModelgetData in interface DataModelkey - the field keyPropertyExceptionpublic String getSchema()
DataModelpublic Map<String,Object> getMap() throws PropertyException
DataModelIt 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.
getMap in interface DataModelPropertyExceptionpublic void setMap(Map<String,Object> data) throws PropertyException
DataModelsetMap in interface DataModeldata - the fields to set as a mapPropertyExceptionpublic boolean isDirty()
DataModelpublic boolean isDirty(String name) throws PropertyNotFoundException
DataModelisDirty in interface DataModelname - the field name to testsPropertyNotFoundExceptionpublic void setDirty(String name) throws PropertyNotFoundException
DataModelsetDirty in interface DataModelname - the field name to be dirtyPropertyNotFoundExceptionpublic Collection<String> getDirtyFields()
DataModelgetDirtyFields in interface DataModelpublic Object getValue(String path) throws PropertyException
DataModelThe path is a subset of XPath: / and [] are supported.
getValue in interface DataModelpath - the property pathPropertyExceptionpublic Object setValue(String path, Object value) throws PropertyException
DataModelsetValue in interface DataModelPropertyExceptionCopyright © 2011 Nuxeo SA. All Rights Reserved.