Class ArrayProperty
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Property>,Property
- Author:
- Bogdan Stefanescu
- See Also:
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.ScalarProperty
field, valueFields inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
flags, forceDirty, IS_DEPRECATED, IS_READONLY, IS_SECURED, NON_CANON_INDEX, parentFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotify the property that its changes was stored so it can safely remove dirty flags.protected Serializableconvert(Collection<?> value) <T> TconvertTo(Serializable value, Class<T> toType) Converts the given normalized value to the given type.protected boolean[]getType()Get the type of the field corresponding to this property.booleanWhether this property is a container - this means the property value is a map or a list.booleanisDirty(int index) This method provides a way to know if some arrayproperty values are dirty: value or index changed. since 7.2booleanisNormalized(Object value) Checks if the given value is a normalized one.protected booleanisSameValue(Serializable value1, Serializable value2) Creates a new and empty instance of a normalized value.Normalizes the given value as dictated by the property type.voidSets this property value.Methods inherited from class org.nuxeo.ecm.core.api.model.impl.ScalarProperty
accept, addEmpty, addValue, addValue, clone, get, get, getChildren, getDirtyChildren, getField, getName, internalGetValue, internalSetValue, isSameAs, set, toStringMethods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
appendDirtyFlags, areFlagsSet, clearFlags, collectPath, computeRemovedProperty, getDefaultValue, getDeprecatedFallback, getDeprecatedParent, getDirtyFlags, getObjectResolver, getParent, getRoot, getSchema, getValue, getValue, getValue, getValue, getValueDeprecation, getValueForWrite, getXPath, getXPath, hasDefaultValue, init, isComplex, isDeprecated, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, isSecured, isSecuredForContext, iterator, moveTo, newDeprecatedMessage, remove, removePhantomFlag, resolvePath, resolvePath, setDirtyFlags, setFlags, setForceDirty, setIsModified, setIsMoved, setIsNew, setIsRemoved, setReadOnly, setValue, setValue, setValueDeprecation, size, validateTypeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ArrayProperty
-
-
Method Details
-
getType
Description copied from interface:PropertyGet the type of the field corresponding to this property.- Specified by:
getTypein interfaceProperty- Overrides:
getTypein classScalarProperty- Returns:
- the property type
-
isContainer
public boolean isContainer()Description copied from interface:PropertyWhether 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
getValuemethods - by collecting the values of the child properties.- Specified by:
isContainerin interfaceProperty- Overrides:
isContainerin classScalarProperty- Returns:
- true if scalar false otherwise
-
setValue
Description copied from interface:PropertySets 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:
setValuein interfaceProperty- Overrides:
setValuein classAbstractProperty- Parameters:
value- the value to set- Throws:
PropertyException
-
isSameValue
- Overrides:
isSameValuein classAbstractProperty
-
isNormalized
Description copied from interface:PropertyChecks if the given value is a normalized one. This means the value has a type that is normalized.Null values are considered as normalized.
- Specified by:
isNormalizedin interfaceProperty- Overrides:
isNormalizedin classAbstractProperty- Parameters:
value- the value to check- Returns:
- true if the value is normalized false otherwise
-
normalize
Description copied from interface:PropertyNormalizes the given value as dictated by the property type.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
SerializableIf the given value is already normalized it will be returned back.
- Specified by:
normalizein interfaceProperty- Overrides:
normalizein classAbstractProperty- Parameters:
value- the value to normalize according to the property type- Returns:
- the normalized value
- Throws:
PropertyConversionException
-
convert
- Throws:
PropertyConversionException
-
convertTo
Description copied from interface:PropertyConverts the given normalized value to the given type.If the value has already the given type it will be returned back.
- Specified by:
convertToin interfaceProperty- Overrides:
convertToin classAbstractProperty- Parameters:
value- the normalized value to converttoType- the conversion type- Returns:
- the converted value, which may be null
- Throws:
PropertyConversionException- if the conversion cannot be made because of type incompatibilities
-
newInstance
Description copied from interface:PropertyCreates a new and empty instance of a normalized value.Empty is used in the sense of a value that has not been initialized or can be considered as an empty value. For example for the
Stringtype the empty value will be the empty string ""- Specified by:
newInstancein interfaceProperty- Overrides:
newInstancein classAbstractProperty- Returns:
- the empty instance the empty instance, or null for some implementations
-
getChildDirty
protected boolean[] getChildDirty() -
isDirty
public boolean isDirty(int index) This method provides a way to know if some arrayproperty values are dirty: value or index changed. since 7.2 -
clearDirtyFlags
public void clearDirtyFlags()Description copied from interface:PropertyNotify the property that its changes was stored so it can safely remove dirty flags.Dirty flags are removed according to the type of the modifications. This way if the property was REMOVED it becomes a PHANTOM otherwise all dirty flags are cleared.
This method should be used by storage implementors to notify the property it should reset its dirty flags. Note that clearing dirty flags is not propagated to the parent property or to children. You need to clear dirty flags explicitly for each property.
- Specified by:
clearDirtyFlagsin interfaceProperty- Overrides:
clearDirtyFlagsin classAbstractProperty
-