public interface PropertyContainer
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
exportFlatMap(String[] schemas)
Exports a flat view of properties in this document.
|
Map<String,Object> |
exportMap(String schemaName) |
Map<String,Map<String,Object>> |
exportMap(String[] schemas)
Exports the properties belonging to the given schemas as a java Map.
|
boolean |
getBoolean(String name)
Gets the value of a scalar property as a
boolean . |
Blob |
getContent(String name)
Gets the value of the named content property.
|
Calendar |
getDate(String name)
Gets the value of a scalar property as a
date . |
List<String> |
getDirtyFields()
Returns fields that were modified.
|
double |
getDouble(String name)
Gets the value of a scalar property as a
double . |
long |
getLong(String name)
Gets the value of a scalar property as a
long . |
Collection<Property> |
getProperties()
Gets the collection of the sub properties in this container.
|
Property |
getProperty(String name)
Gets a property given its name.
|
Iterator<Property> |
getPropertyIterator()
Gets an iterator over all existing properties in this container.
|
Object |
getPropertyValue(String name)
Generic method to retrieve a property value.
|
String |
getString(String name)
Gets the value of a scalar property as a
string . |
void |
importFlatMap(Map<String,Object> map)
Imports a flat map of properties into this document.
|
void |
importMap(Map<String,Map<String,Object>> map)
Imports the tree properties from the given Java Map.
|
boolean |
isPropertySet(String path)
Tests whether the property at the given path exists (the property may be
either a scalar or a composite one).
|
void |
removeProperty(String name)
Removes the property with the given name.
|
void |
setBoolean(String name,
boolean value)
Sets the scalar property value to the given boolean value.
|
void |
setContent(String name,
Blob value)
Sets the content property to the given value.
|
void |
setDate(String name,
Calendar value)
Sets the scalar property value to the given date value.
|
void |
setDouble(String name,
double value)
Set the scalar property value to the given double value.
|
void |
setLong(String name,
long value)
Sets the scalar property value to the given long value.
|
void |
setPropertyValue(String name,
Object value)
Generic method to set a property value.
|
void |
setString(String name,
String value)
Sets the scalar property value to the given string value.
|
boolean isPropertySet(String path) throws DocumentException
path
- the path to testDocumentException
- if any error occursProperty getProperty(String name) throws DocumentException
If the named property is specified by schema of the container object this method will always return a property object even if the property was not yet set (doesn't exists).
In this case the method Property.isNull()
of the returned
property will return true. If the property is not specified by any
container schema the NoSuchPropertyException
will be thrown
returns non null even if the property corresponding to that name was not
previously set. The returned object is a scalar, composite or list
property.
name
- the property name to retrieveDocumentException
- if any error occursvoid removeProperty(String name) throws DocumentException
name
- the property to removeDocumentException
- if any error occursvoid setPropertyValue(String name, Object value) throws DocumentException
This is a shortcut for getProperty(String).setValue(Object)
The following type of objects can be used as values depending on the property type:
name
- the name of the property to setvalue
- the value to setDocumentException
- if any error occursObject getPropertyValue(String name) throws DocumentException
This is a shortcut for getProperty(String).getValue()
name
- the name of the property to setnull
if the property is not
set.DocumentException
- if any error occursfor the list of supported value
objects
String getString(String name) throws DocumentException
string
.
This is a shortcut for getScalar(name).getString()
DocumentException
- if any error occursSimpleProperty#getString()};
boolean getBoolean(String name) throws DocumentException
boolean
.
This is a shortcut for getScalar(name).getBoolean()
DocumentException
- if any error occursSimpleProperty#getBoolean()};
double getDouble(String name) throws DocumentException
double
.
This is a shortcut for getScalar(name).getDouble()
DocumentException
- if any error occursSimpleProperty#getDouble()};
long getLong(String name) throws DocumentException
long
.
This is a shortcut for getScalar(name).getLong()
DocumentException
- if any error occursSimpleProperty#getLong()};
Calendar getDate(String name) throws DocumentException
date
.
This is a shortcut for getScalar(name).getDate()
DocumentException
- if any error occursSimpleProperty#getDate()};
Blob getContent(String name) throws DocumentException
DocumentException
- if any error occursvoid setString(String name, String value) throws DocumentException
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set string properties.
DocumentException
- if any error occursSimpleProperty#setString(String)}
void setBoolean(String name, boolean value) throws DocumentException
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set boolean properties.
DocumentException
- if any error occursSimpleProperty#setBoolean(boolean)}
void setLong(String name, long value) throws DocumentException
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set long properties.
DocumentException
- if any error occursSimpleProperty#setLong(long)}
void setDouble(String name, double value) throws DocumentException
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set double properties
DocumentException
- if any error occursSimpleProperty#setDouble(double)}
void setDate(String name, Calendar value) throws DocumentException
If the property with that name doesn't exists, it will be created
This is a shortcut to create or set date properties.
DocumentException
- if any error occursSimpleProperty#setDate(Calendar)}
void setContent(String name, Blob value) throws DocumentException
If the property with that name doesn't exists, it will be created
DocumentException
- if any error occursMap<String,Map<String,Object>> exportMap(String[] schemas) throws DocumentException
If the given schemas array is null then all schemas will be exported
The properties are grouped by schemas
The property tree is recursively traversed and all property in that schema exported as entry of the Map
schemas
- DocumentException
- if any error occursMap<String,Object> exportMap(String schemaName) throws DocumentException
DocumentException
void importMap(Map<String,Map<String,Object>> map) throws DocumentException
The property tree is recursively traversed and all property exported as entry of the Map.
DocumentException
- if any error occursMap<String,Object> exportFlatMap(String[] schemas) throws DocumentException
If the given schemas array is null then all schemas will be exported.
schemas
- DocumentException
- if any error occursvoid importFlatMap(Map<String,Object> map) throws DocumentException
map
- DocumentException
- if any error occursCollection<Property> getProperties() throws DocumentException
The returned properties are existing.
DocumentException
- if any error occursIterator<Property> getPropertyIterator() throws DocumentException
The returned properties are existing.
DocumentException
- if any error occursCopyright © 2011 Nuxeo SA. All Rights Reserved.