Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.model.impl
Class DocumentPartImpl

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.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

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
DocumentPartImpl(Schema schema)
           
DocumentPartImpl(Schema schema, PropertyFactory factory)
           
 
Method Summary
 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)
           
 void deserialize(ObjectInputStream in)
           
 void deserializeChildren(ComplexProperty parent, ObjectInputStream in)
           
 void deserializeChildren(ListProperty parent, ObjectInputStream in)
           
 PropertyDiff exportDiff()
           
 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.
 void importDiff(PropertyDiff diff)
           
 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)
           
 void serialize(ObjectOutputStream out)
           
 String toString()
           
 
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, getValueForWrite, init, internalGetValue, isEmpty, isNormalized, isSameAs, keySet, normalize, put, putAll, remove, setValue, values, visitChildren
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
areFlagsSet, clearDirtyFlags, clearFlags, convertTo, getData, getData, getDirtyFlags, getParent, getPath, getRoot, 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, validate, validateType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nuxeo.ecm.core.api.model.Property
addEmpty, addValue, addValue, clearDirtyFlags, convertTo, get, get, getChildren, getData, getData, getDirtyChildren, getDirtyFlags, getParent, getPath, getRoot, getValue, getValue, getValue, getValue, getValueForWrite, init, isComplex, isDirty, isList, isModified, isMoved, isNew, isNormalized, isPhantom, isReadOnly, isRemoved, isSameAs, isScalar, isValidating, moveTo, newInstance, normalize, remove, resolvePath, resolvePath, setData, setData, setReadOnly, setValidating, setValue, setValue, setValue, size, validate, validateType
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface java.util.Map
equals, hashCode, size
 

Constructor Detail

DocumentPartImpl

public DocumentPartImpl(Schema schema,
                        PropertyFactory factory)

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 class AbstractProperty
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 interface Property
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 interface DocumentPart
Specified by:
getSchema in interface Property
Overrides:
getSchema in class AbstractProperty
Returns:
the document schema owning the field corresponding to the property

getName

public String getName()
Description copied from interface: Property
Gets the property name.

Specified by:
getName in interface Property
Returns:
the property name

getType

public Schema getType()
Description copied from interface: Property
Get the type of the field corresponding to this property.

Specified by:
getType in interface Property
Specified by:
getType in class ComplexProperty
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

Specified by:
getField in interface Property
Returns:

collectPath

public Path collectPath(Path path)

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
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 interface Property
Parameters:
visitor - the visitor to accept
arg - 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 interface DocumentPart

createProperty

public Property createProperty(Property parent,
                               Field field,
                               int flags)
Specified by:
createProperty in interface DocumentPart

exportDiff

public PropertyDiff exportDiff()
Specified by:
exportDiff in interface DocumentPart

importDiff

public void importDiff(PropertyDiff diff)
Specified by:
importDiff in interface DocumentPart

serialize

public void serialize(ObjectOutputStream out)
               throws PropertyException,
                      IOException
Throws:
PropertyException
IOException

deserialize

public void deserialize(ObjectInputStream in)
                 throws ClassNotFoundException,
                        IOException,
                        PropertyException
Throws:
ClassNotFoundException
IOException
PropertyException

deserializeChildren

public void deserializeChildren(ListProperty parent,
                                ObjectInputStream in)
                         throws ClassNotFoundException,
                                IOException,
                                PropertyException
Throws:
ClassNotFoundException
IOException
PropertyException

deserializeChildren

public void deserializeChildren(ComplexProperty parent,
                                ObjectInputStream in)
                         throws ClassNotFoundException,
                                IOException,
                                PropertyException
Throws:
ClassNotFoundException
IOException
PropertyException

isSameAs

public boolean isSameAs(DocumentPart dp)

toString

public String toString()
Overrides:
toString in class AbstractProperty

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.