Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.model.impl.primitives
Class BlobProperty

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
                  extended by org.nuxeo.ecm.core.api.model.impl.osm.ObjectProperty
                      extended by org.nuxeo.ecm.core.api.model.impl.primitives.BlobProperty
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Property>, Map<String,Property>, Adaptable, Property

public class BlobProperty
extends ObjectProperty

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
BlobProperty(Property parent, Field field, int flags)
           
 
Method Summary
<T> T
convertTo(Serializable value, Class<T> toType)
          Converts the given normalized value to the given type.
static ObjectAdapter getObjectMetaData()
           
 boolean isNormalized(Object value)
          Checks if the given value is a normalized one.
 Object newInstance()
          Creates a new and empty instance of a normalized value.
 Serializable normalize(Object value)
          Normalizes the given value as dictated by the property type.
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.osm.ObjectProperty
clone, internalGetValue, internalSetValue
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.osm.ComplexMemberProperty
getAdapter, getValueForWrite, init, isContainer, isSameAs, setValue
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.MapProperty
accept, 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, keySet, put, putAll, remove, values, visitChildren
 
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
areFlagsSet, clearDirtyFlags, clearFlags, getData, getData, getDirtyFlags, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValue, isComplex, isDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, isValidating, iterator, moveTo, 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

BlobProperty

public BlobProperty(Property parent,
                    Field field,
                    int flags)
Method Detail

getObjectMetaData

public static ObjectAdapter getObjectMetaData()

isNormalized

public boolean isNormalized(Object value)
Description copied from interface: Property
Checks 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:
isNormalized in interface Property
Overrides:
isNormalized in class ComplexProperty
Parameters:
value - the value to check
Returns:
true if the value is normalized false otherwise

normalize

public Serializable normalize(Object value)
                       throws PropertyConversionException
Description copied from interface: Property
Normalizes 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 Serializable

If the given value is already normalized it will be returned back.

Specified by:
normalize in interface Property
Overrides:
normalize in class ComplexProperty
Parameters:
value - the value to normalize according to the property type
Returns:
the normalized value
Throws:
PropertyConversionException

convertTo

public <T> T convertTo(Serializable value,
                       Class<T> toType)
            throws PropertyConversionException
Description copied from interface: Property
Converts the given normalized value to the given type.

If the value has already the given type it will be returned back.

Specified by:
convertTo in interface Property
Overrides:
convertTo in class AbstractProperty
Parameters:
value - the normalized value to convert
toType - the conversion type
Returns:
the converted value, which may be null
Throws:
PropertyConversionException - if the conversion cannot be made because of type incompatibilities

newInstance

public Object newInstance()
Description copied from interface: Property
Creates 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 String type the empty value will be the empty string ""

Specified by:
newInstance in interface Property
Overrides:
newInstance in class AbstractProperty
Returns:
the empty instance the empty instance, or null for some implementations

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.