|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.api.model.impl.AbstractProperty org.nuxeo.ecm.core.api.model.impl.ComplexProperty
public abstract class ComplexProperty
A scalar property that is linked to a schema field
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty |
---|
IS_READONLY, IS_VALIDATING, KEYED_DATA |
Fields inherited from interface org.nuxeo.ecm.core.api.model.Property |
---|
DIRTY_MASK, IS_DIRTY, IS_MODIFIED, IS_MOVED, IS_NEW, IS_PHANTOM, IS_REMOVED, NONE |
Method Summary | |
---|---|
Property |
addEmpty()
Creates an empty child property and adds it as a property to the list container. |
Property |
addValue(int index,
Object value)
Inserts at the given position a new value to the list. |
Property |
addValue(Object value)
Appends a new value to the list. |
void |
clear()
Throws UnsupportedOperationException, added to implement List |
boolean |
containsKey(Object key)
Throws UnsupportedOperationException, added to implement List |
boolean |
containsValue(Object value)
Throws UnsupportedOperationException, added to implement List |
Set<Map.Entry<String,Property>> |
entrySet()
|
Property |
get(int index)
Get the child property given it's index. |
Property |
get(Object key)
|
Property |
get(String name)
Gets the child property having the given name. |
Property |
getChild(Field field)
|
Collection<Property> |
getChildren()
Get a collection over the children properties. |
Iterator<Property> |
getDirtyChildren()
Gets an iterator over the dirty children properties. |
Property |
getNonPhantomChild(Field field)
|
Collection<Property> |
getNonPhantomChildren()
|
abstract ComplexType |
getType()
Get the type of the field corresponding to this property. |
Serializable |
getValueForWrite()
Gets the property normalized value for write. |
void |
init(Serializable value)
Initializes the property with the given normalized value. |
Serializable |
internalGetValue()
|
boolean |
isEmpty()
|
boolean |
isNormalized(Object value)
Checks if the given value is a normalized one. |
boolean |
isSameAs(Property property)
Should be used by container properties. |
Set<String> |
keySet()
|
Serializable |
normalize(Object value)
Normalizes the given value as dictated by the property type. |
Property |
put(String key,
Property value)
Throws UnsupportedOperationException, added to implement List |
void |
putAll(Map<? extends String,? extends Property> t)
Throws UnsupportedOperationException, added to implement List |
Property |
remove(Object key)
Throws UnsupportedOperationException, added to implement List |
void |
setValue(Object value)
Sets this property value. |
Collection<Property> |
values()
|
void |
visitChildren(PropertyVisitor visitor,
Object arg)
|
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty |
---|
areFlagsSet, clearDirtyFlags, clearFlags, convertTo, getData, getData, getDirtyFlags, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValue, internalSetValue, isComplex, isDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, isValidating, iterator, moveTo, newInstance, remove, removePhantomFlag, resolvePath, resolvePath, setData, setData, setFlags, setIsModified, setReadOnly, setValidating, setValue, setValue, size, toString, validate, validateType |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode, size |
Methods inherited from interface org.nuxeo.ecm.core.api.model.Property |
---|
accept, getField, getName, isContainer |
Method Detail |
---|
public abstract ComplexType getType()
Property
getType
in interface Property
public boolean isNormalized(Object value)
Property
Null values are considered as normalized.
isNormalized
in interface Property
isNormalized
in class AbstractProperty
value
- the value to check
public Serializable normalize(Object value) throws PropertyConversionException
Property
Normalized values are the ones that are used for transportation over the net and that are given to the storage implementation to be stored in the repository
Normalized values must be Serializable
If the given value is already normalized it will be returned back.
normalize
in interface Property
normalize
in class AbstractProperty
value
- the value to normalize according to the property type
PropertyConversionException
public Property get(int index)
Property
If this method is not supported an UnsupportedOperationException
must be thrown
Relative paths are not resolved. THis method is intended to lookup direct
chilren. For path lookups, use Property.resolvePath(String)
instead.
get
in interface Property
public final Property getNonPhantomChild(Field field)
public final Property getChild(Field field)
public final Collection<Property> getNonPhantomChildren()
public Collection<Property> getChildren()
Property
The returned collection is ordered for list properties, and unordered for complex properties
Be aware that this method is creating phantom child properties for all schema fields that are not yet set.
getChildren
in interface Property
public Property get(String name) throws PropertyNotFoundException
Property
If the property is a scalar, this will return always null.
The given name should be the full name (i.e. prefixed name if any prefix exists).
If a non prefixed name is given, the first child property having the given local name will be returned.
Relative paths are not resolved. THis method is intended to lookup direct
children. For path lookups use Property.resolvePath(String)
instead.
get
in interface Property
name
- the child property name (the full name including the prefix
if any)
PropertyNotFoundException
public Serializable internalGetValue() throws PropertyException
internalGetValue
in class AbstractProperty
PropertyException
public Serializable getValueForWrite() throws PropertyException
Property
Can be different fropm Property.getValue()
in cases where the property
adapts the value it is given to store.
getValueForWrite
in interface Property
getValueForWrite
in class AbstractProperty
PropertyException
public void init(Serializable value) throws PropertyException
Property
The given value must be normalized - note that no check is done on that.
The phantom flag is unset by this operation.
This method should be used to initialize properties.
init
in interface Property
init
in class AbstractProperty
value
- the normalized value to set
PropertyException
public void setValue(Object value) throws PropertyException
Property
For complex or list properties the value will be set recursively (as a map or list value).
setValue
in interface Property
setValue
in class AbstractProperty
value
- the value to set
PropertyException
public Property addValue(Object value)
Property
The created property will be marked as Property.isNew()
.
addValue
in interface Property
public Property addValue(int index, Object value)
Property
The created property will be marked as Property.isNew()
.
addValue
in interface Property
index
- the position to insert the value
public Property addEmpty()
Property
This method is useful to construct lists.
addEmpty
in interface Property
public void visitChildren(PropertyVisitor visitor, Object arg) throws PropertyException
PropertyException
public boolean isSameAs(Property property) throws PropertyException
isSameAs
in interface Property
PropertyException
public Iterator<Property> getDirtyChildren()
Property
getDirtyChildren
in interface Property
public void clear()
clear
in interface Map<String,Property>
public boolean containsKey(Object key)
containsKey
in interface Map<String,Property>
public boolean containsValue(Object value)
containsValue
in interface Map<String,Property>
public Set<Map.Entry<String,Property>> entrySet()
entrySet
in interface Map<String,Property>
public Property get(Object key)
get
in interface Map<String,Property>
public boolean isEmpty()
isEmpty
in interface Map<String,Property>
public Set<String> keySet()
keySet
in interface Map<String,Property>
public Property put(String key, Property value)
put
in interface Map<String,Property>
public void putAll(Map<? extends String,? extends Property> t)
putAll
in interface Map<String,Property>
public Property remove(Object key)
remove
in interface Map<String,Property>
public Collection<Property> values()
values
in interface Map<String,Property>
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |