Class DocumentPartImpl
- java.lang.Object
-
- org.nuxeo.ecm.core.api.model.impl.AbstractProperty
-
- org.nuxeo.ecm.core.api.model.impl.ComplexProperty
-
- org.nuxeo.ecm.core.api.model.impl.DocumentPartImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Property>
,Map<String,Property>
,DocumentPart
,Property
public class DocumentPartImpl extends ComplexProperty implements DocumentPart
- Author:
- Bogdan Stefanescu
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
clearComplexPropertyBeforeSet
protected Schema
schema
-
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.ComplexProperty
children
-
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
flags, forceDirty, IS_DEPRECATED, IS_READONLY, IS_SECURED, NON_CANON_INDEX, parent
-
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
Constructors Constructor Description DocumentPartImpl(Schema schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(PropertyVisitor visitor, Object arg)
Method that implement the visitor pattern.Object
clone()
Path
collectPath(Path path)
Property
createProperty(Property parent, Field field)
Property
createProperty(Property parent, Field field, int flags)
boolean
getClearComplexPropertyBeforeSet()
Whether or not to ignore any previous values when setting complex properties.Field
getField()
Gets the field corresponding to this property.String
getName()
Gets the property name.Schema
getSchema()
Gets the document schema defining the property tree from which the property belongs.Schema
getType()
Get the type of the field corresponding to this property.Serializable
getValue()
Gets the property normalized value.Serializable
getValueForWrite()
Gets the property normalized value for write.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(DocumentPart dp)
String
toString()
-
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.ComplexProperty
addEmpty, addValue, addValue, clear, clearDirtyFlags, containsKey, containsValue, entrySet, get, get, get, getChild, getChildren, getDefaultValue, getDirtyChildren, getNonPhantomChild, getNonPhantomChildren, init, internalGetChild, internalGetValue, isEmpty, isNormalized, isSameAs, keySet, normalize, put, putAll, remove, set, setValue, values, visitChildren
-
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
appendDirtyFlags, areFlagsSet, clearFlags, computeRemovedProperty, convertTo, getDeprecatedFallback, getDeprecatedParent, getDirtyFlags, getObjectResolver, getParent, getPath, getRoot, getValue, getValue, getValue, getValueDeprecation, getXPath, getXPath, hasDefaultValue, isComplex, isDeprecated, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isSameValue, isScalar, isSecured, isSecuredForContext, iterator, moveTo, newDeprecatedMessage, newInstance, remove, removePhantomFlag, resolvePath, resolvePath, setDirtyFlags, setFlags, setForceDirty, setIsModified, setIsMoved, setIsNew, setIsRemoved, setReadOnly, setValue, setValue, setValueDeprecation, size, validateType
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
Methods inherited from interface org.nuxeo.ecm.core.api.model.Property
addEmpty, addValue, addValue, clearDirtyFlags, convertTo, get, get, getChildren, getDirtyChildren, getDirtyFlags, getObjectResolver, getParent, getPath, getRoot, getValue, getValue, getValue, getXPath, hasDefaultValue, init, isComplex, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isNormalized, isPhantom, isReadOnly, isRemoved, isSameAs, isScalar, isSecured, moveTo, newInstance, normalize, remove, resolvePath, resolvePath, set, setForceDirty, setReadOnly, setValue, setValue, setValue, size, validateType
-
-
-
-
Field Detail
-
schema
protected Schema schema
-
clearComplexPropertyBeforeSet
protected boolean clearComplexPropertyBeforeSet
-
-
Constructor Detail
-
DocumentPartImpl
public DocumentPartImpl(Schema schema)
-
-
Method Detail
-
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.
- Specified by:
internalSetValue
in classAbstractProperty
- Throws:
PropertyException
-
getValue
public Serializable getValue() throws PropertyException
Description copied from interface:Property
Gets the property normalized value.Normalized values are of the java type that correspond to the field type.
- Specified by:
getValue
in interfaceProperty
- Overrides:
getValue
in classAbstractProperty
- Returns:
- the property value, which may be null
- 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 interfaceProperty
- Overrides:
getValueForWrite
in classComplexProperty
- Returns:
- the property value to use for write, which may be null
- Throws:
PropertyException
-
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 interfaceProperty
- Returns:
- true if scalar false otherwise
-
getSchema
public Schema getSchema()
Description copied from interface:Property
Gets the document schema defining the property tree from which the property belongs.- Specified by:
getSchema
in interfaceDocumentPart
- Specified by:
getSchema
in interfaceProperty
- Overrides:
getSchema
in classAbstractProperty
- Returns:
- the document schema owning the field corresponding to the property
-
getType
public Schema getType()
Description copied from interface:Property
Get the type of the field corresponding to this property.- Specified by:
getType
in interfaceProperty
- Specified by:
getType
in classComplexProperty
- Returns:
- the property type
-
getField
public Field getField()
Description copied from interface:Property
Gets the field corresponding to this property.The field is the object defining the property. You can see the field as a java class and the property as a class instance
-
collectPath
public Path collectPath(Path path)
- Overrides:
collectPath
in classAbstractProperty
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
accept
public void accept(PropertyVisitor visitor, Object arg) throws PropertyException
Description copied from interface:Property
Method that implement the visitor pattern.The visitor must return null to stop visiting children otherwise a context object that will be passed as the arg argument to children
- Specified by:
accept
in interfaceProperty
- Parameters:
visitor
- the visitor to acceptarg
- an argument passed to the visitor. This should be used by the visitor to carry on the visiting context.- Throws:
PropertyException
-
createProperty
public Property createProperty(Property parent, Field field)
- Specified by:
createProperty
in interfaceDocumentPart
-
createProperty
public Property createProperty(Property parent, Field field, int flags)
- Specified by:
createProperty
in interfaceDocumentPart
-
getClearComplexPropertyBeforeSet
public boolean getClearComplexPropertyBeforeSet()
Description copied from interface:DocumentPart
Whether or not to ignore any previous values when setting complex properties.- Specified by:
getClearComplexPropertyBeforeSet
in interfaceDocumentPart
- Returns:
true
if setting a complex property ignores any previous values
-
isSameAs
public boolean isSameAs(DocumentPart dp)
-
toString
public String toString()
- Overrides:
toString
in classAbstractProperty
-
-