|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.api.impl.SimpleDocumentModel.SimpleDataModel
public static class SimpleDocumentModel.SimpleDataModel
A data model that is not tied to a particular schema, neither has anything to do with a session (CoreSession).
Field Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
data
|
java.lang.String |
schema
|
Constructor Summary | |
---|---|
SimpleDocumentModel.SimpleDataModel(java.lang.String schema)
|
Method Summary | |
---|---|
java.lang.Object |
getData(java.lang.String key)
Gets the named field value. |
java.util.Collection<java.lang.String> |
getDirtyFields()
Gets the collection of the dirty fields in this data model. |
java.util.Map<java.lang.String,java.lang.Object> |
getMap()
Gets all the fields set in this data model. |
java.lang.String |
getSchema()
Gets the schema of this data model. |
java.lang.Object |
getValue(java.lang.String path)
Gets a value given its path. |
boolean |
isDirty()
Tests whether or not this data model is dirty (i.e. it was changed by the client). |
boolean |
isDirty(java.lang.String name)
Tests whether or not the specified field from this data model is dirty. |
void |
setData(java.lang.String key,
java.lang.Object value)
Sets the name field. |
void |
setDirty(java.lang.String name)
Marks the specified field from this data model as dirty. |
void |
setMap(java.util.Map<java.lang.String,java.lang.Object> data)
Sets several field at once. |
java.lang.Object |
setValue(java.lang.String path,
java.lang.Object value)
Sets a value to a property given its path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String schema
public java.util.Map<java.lang.String,java.lang.Object> data
Constructor Detail |
---|
public SimpleDocumentModel.SimpleDataModel(java.lang.String schema)
Method Detail |
---|
public void setData(java.lang.String key, java.lang.Object value) throws PropertyException
DataModel
setData
in interface DataModel
key
- the field namevalue
- the value to set. Accept null values.
PropertyException
public java.lang.Object getData(java.lang.String key) throws PropertyException
DataModel
getData
in interface DataModel
key
- the field key
PropertyException
public java.lang.String getSchema()
DataModel
getSchema
in interface DataModel
public java.util.Map<java.lang.String,java.lang.Object> getMap() throws PropertyException
DataModel
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.
getMap
in interface DataModel
PropertyException
public void setMap(java.util.Map<java.lang.String,java.lang.Object> data) throws PropertyException
DataModel
setMap
in interface DataModel
data
- the fields to set as a map
PropertyException
public boolean isDirty()
DataModel
isDirty
in interface DataModel
public boolean isDirty(java.lang.String name) throws PropertyNotFoundException
DataModel
isDirty
in interface DataModel
name
- the field name to tests
PropertyNotFoundException
public void setDirty(java.lang.String name) throws PropertyNotFoundException
DataModel
setDirty
in interface DataModel
name
- the field name to be dirty
PropertyNotFoundException
public java.util.Collection<java.lang.String> getDirtyFields()
DataModel
getDirtyFields
in interface DataModel
public java.lang.Object getValue(java.lang.String path) throws PropertyException
DataModel
The path is a subset of XPath: / and [] are supported.
getValue
in interface DataModel
path
- the property path
PropertyException
public java.lang.Object setValue(java.lang.String path, java.lang.Object value) throws PropertyException
DataModel
setValue
in interface DataModel
PropertyException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |