public class SQLComplexProperty extends SQLBaseProperty implements PropertyContainer
SQLComplexProperty
gives access to a wrapped SQL-level Node
. This is used for documents and for complex properties.DC_ISSUED, RELATED_TEXT_RESOURCES
Constructor and Description |
---|
SQLComplexProperty(Node node,
ComplexType type,
SQLSession session,
boolean readonly)
Creates a
SQLComplexProperty to wrap a Node . |
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 . |
String |
getName()
Gets the name used to identify this property by its container.
|
Node |
getNode() |
Collection<Property> |
getProperties()
Gets the collection of the children properties.
|
Property |
getProperty(String name)
Gets the children property given its name.
|
Iterator<Property> |
getPropertyIterator()
Gets an iterator over the children properties.
|
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 . |
Object |
getValue()
Gets the value of this property.
|
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 name)
Checks whether this property has child property with the given name.
|
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.
|
void |
setValue(Object value)
Sets the value of this property.
|
checkWritable, getType, isNull, isSpecialSystemProperty, setNull
public SQLComplexProperty(Node node, ComplexType type, SQLSession session, boolean readonly)
SQLComplexProperty
to wrap a Node
.public Node getNode()
public String getName()
Property
If the container of this property is not supporting accessing properties by names, returns the empty string.
public Object getValue() throws DocumentException
Property
getValue
in interface Property
DocumentException
public void setValue(Object value) throws DocumentException
Property
setValue
in interface Property
value
- the value to setDocumentException
public boolean isPropertySet(String name) throws DocumentException
Property
isPropertySet
in interface Property
isPropertySet
in interface PropertyContainer
isPropertySet
in class SQLBaseProperty
name
- the path to testDocumentException
- if any error occurspublic Property getProperty(String name) throws DocumentException
Property
getProperty
in interface Property
getProperty
in interface PropertyContainer
getProperty
in class SQLBaseProperty
name
- the property nameDocumentException
- if any error occurspublic Collection<Property> getProperties() throws DocumentException
Property
getProperties
in interface Property
getProperties
in interface PropertyContainer
getProperties
in class SQLBaseProperty
DocumentException
- if any error occurspublic Iterator<Property> getPropertyIterator() throws DocumentException
Property
getPropertyIterator
in interface Property
getPropertyIterator
in interface PropertyContainer
getPropertyIterator
in class SQLBaseProperty
DocumentException
- if any error occurspublic Map<String,Object> exportFlatMap(String[] schemas) throws DocumentException
PropertyContainer
If the given schemas array is null then all schemas will be exported.
exportFlatMap
in interface PropertyContainer
DocumentException
- if any error occurspublic Map<String,Map<String,Object>> exportMap(String[] schemas) throws DocumentException
PropertyContainer
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
exportMap
in interface PropertyContainer
DocumentException
- if any error occurspublic Map<String,Object> exportMap(String schemaName) throws DocumentException
exportMap
in interface PropertyContainer
DocumentException
public void importFlatMap(Map<String,Object> map) throws DocumentException
PropertyContainer
importFlatMap
in interface PropertyContainer
DocumentException
- if any error occurspublic void importMap(Map<String,Map<String,Object>> map) throws DocumentException
PropertyContainer
The property tree is recursively traversed and all property exported as entry of the Map.
importMap
in interface PropertyContainer
DocumentException
- if any error occurspublic List<String> getDirtyFields()
PropertyContainer
XXX AT: compatibility method for NXP-666
getDirtyFields
in interface PropertyContainer
public Object getPropertyValue(String name) throws DocumentException
PropertyContainer
This is a shortcut for getProperty(String).getValue()
getPropertyValue
in interface PropertyContainer
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
public String getString(String name) throws DocumentException
PropertyContainer
string
.
This is a shortcut for getScalar(name).getString()
getString
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#getString()};
public boolean getBoolean(String name) throws DocumentException
PropertyContainer
boolean
.
This is a shortcut for getScalar(name).getBoolean()
getBoolean
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#getBoolean()};
public long getLong(String name) throws DocumentException
PropertyContainer
long
.
This is a shortcut for getScalar(name).getLong()
getLong
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#getLong()};
public double getDouble(String name) throws DocumentException
PropertyContainer
double
.
This is a shortcut for getScalar(name).getDouble()
getDouble
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#getDouble()};
public Calendar getDate(String name) throws DocumentException
PropertyContainer
date
.
This is a shortcut for getScalar(name).getDate()
getDate
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#getDate()};
public Blob getContent(String name) throws DocumentException
PropertyContainer
getContent
in interface PropertyContainer
DocumentException
- if any error occurspublic void setPropertyValue(String name, Object value) throws DocumentException
PropertyContainer
This is a shortcut for getProperty(String).setValue(Object)
The following type of objects can be used as values depending on the property type:
setPropertyValue
in interface PropertyContainer
name
- the name of the property to setvalue
- the value to setDocumentException
- if any error occurspublic void setString(String name, String value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set string properties.
setString
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#setString(String)}
public void setBoolean(String name, boolean value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set boolean properties.
setBoolean
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#setBoolean(boolean)}
public void setLong(String name, long value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set long properties.
setLong
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#setLong(long)}
public void setDouble(String name, double value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created.
This is a shortcut to create or set double properties
setDouble
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#setDouble(double)}
public void setDate(String name, Calendar value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created
This is a shortcut to create or set date properties.
setDate
in interface PropertyContainer
DocumentException
- if any error occursSimpleProperty#setDate(Calendar)}
public void setContent(String name, Blob value) throws DocumentException
PropertyContainer
If the property with that name doesn't exists, it will be created
setContent
in interface PropertyContainer
DocumentException
- if any error occurspublic void removeProperty(String name) throws DocumentException
PropertyContainer
removeProperty
in interface PropertyContainer
name
- the property to removeDocumentException
- if any error occursCopyright © 2013 Nuxeo SA. All Rights Reserved.