Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.model.impl.osm
Class ComplexMemberProperty

java.lang.Object
  extended by org.nuxeo.ecm.core.api.model.impl.AbstractProperty
      extended by org.nuxeo.ecm.core.api.model.impl.ComplexProperty
          extended by org.nuxeo.ecm.core.api.model.impl.MapProperty
              extended by org.nuxeo.ecm.core.api.model.impl.osm.ComplexMemberProperty
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Property>, Map<String,Property>, Adaptable, Property
Direct Known Subclasses:
ObjectProperty

public class ComplexMemberProperty
extends MapProperty
implements Adaptable

Author:
Bogdan Stefanescu
See Also:
Serialized Form

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
 
Constructor Summary
ComplexMemberProperty(ObjectAdapter adapter, Property parent, Field field)
           
ComplexMemberProperty(ObjectAdapter adapter, Property parent, Field field, int flags)
           
 
Method Summary
 ObjectAdapter getAdapter()
           
 Serializable getValueForWrite()
          Gets the property normalized value for write.
 void init(Serializable value)
          Initializes the property with the given normalized value.
 Serializable internalGetValue()
           
 void internalSetValue(Serializable value)
          Sets the given normalized value.
 boolean isContainer()
          Whether this property is a container - this means the property value is a map or a list.
 boolean isSameAs(Property property)
          Should be used by container properties.
 void setValue(Object value)
          Sets this property value.
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.MapProperty
accept, clone, getField, getName, getType
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.ComplexProperty
addEmpty, addValue, addValue, clear, containsKey, containsValue, entrySet, get, get, get, getChild, getChildren, getDirtyChildren, getNonPhantomChild, getNonPhantomChildren, isEmpty, isNormalized, keySet, normalize, put, putAll, remove, values, visitChildren
 
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, 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
 

Constructor Detail

ComplexMemberProperty

public ComplexMemberProperty(ObjectAdapter adapter,
                             Property parent,
                             Field field)

ComplexMemberProperty

public ComplexMemberProperty(ObjectAdapter adapter,
                             Property parent,
                             Field field,
                             int flags)
Method Detail

getAdapter

public ObjectAdapter getAdapter()
Specified by:
getAdapter in interface Adaptable

isContainer

public boolean isContainer()
Description copied from interface: Property
Whether this property is a container - this means the property value is a map or a list.

Container properties don't have a scalar values. Container values are computed each time they are requested - by calling on of the getValue methods - by collecting the values of the child properties.

Specified by:
isContainer in interface Property
Overrides:
isContainer in class MapProperty
Returns:
true if scalar false otherwise

setValue

public void setValue(Object value)
              throws PropertyException
Description copied from interface: Property
Sets this property value. The value will be first normalized and then set.

For complex or list properties the value will be set recursively (as a map or list value).

Specified by:
setValue in interface Property
Overrides:
setValue in class ComplexProperty
Parameters:
value - the value to set
Throws:
PropertyException

init

public void init(Serializable value)
          throws PropertyException
Description copied from interface: Property
Initializes the property with the given normalized value.

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.

Specified by:
init in interface Property
Overrides:
init in class ComplexProperty
Parameters:
value - the normalized value to set
Throws:
PropertyException

internalSetValue

public void internalSetValue(Serializable value)
                      throws PropertyException
Description copied from class: AbstractProperty
Sets the given normalized value.

This applies only for nodes that physically store a value (that means non container nodes). Container nodes does nothing.

Overrides:
internalSetValue in class MapProperty
Throws:
PropertyException

internalGetValue

public Serializable internalGetValue()
                              throws PropertyException
Overrides:
internalGetValue in class ComplexProperty
Throws:
PropertyException

getValueForWrite

public Serializable getValueForWrite()
                              throws PropertyException
Description copied from interface: Property
Gets the property normalized value for write.

Can be different fropm Property.getValue() in cases where the property adapts the value it is given to store.

Specified by:
getValueForWrite in interface Property
Overrides:
getValueForWrite in class ComplexProperty
Returns:
the property value to use for write, which may be null
Throws:
PropertyException

isSameAs

public boolean isSameAs(Property property)
                 throws PropertyException
Description copied from class: ComplexProperty
Should be used by container properties. Non container props must overwrite this.

Specified by:
isSameAs in interface Property
Overrides:
isSameAs in class ComplexProperty
Returns:
true If the properties have a similar content, otherwise false
Throws:
PropertyException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.