public class BlobProperty extends MapProperty
Blob
object.Modifier and Type | Class and Description |
---|---|
static class |
BlobProperty.ScalarMemberProperty |
forceDirty, IS_READONLY, parent
DIRTY_MASK, IS_DIRTY, IS_MODIFIED, IS_MOVED, IS_NEW, IS_PHANTOM, IS_REMOVED, NONE
Constructor and Description |
---|
BlobProperty(Property parent,
Field field,
int flags) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
<T> T |
convertTo(Serializable value,
Class<T> toType)
Converts the given normalized value to the given type.
|
Serializable |
getDefaultValue() |
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 |
isNormalized(Object value)
Checks if the given value is a normalized one.
|
boolean |
isSameAs(Property property)
Should be used by container properties.
|
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.
|
void |
setValue(Object value)
Sets this property value.
|
accept, getField, getName, getType
addEmpty, addValue, addValue, clear, clearDirtyFlags, containsKey, containsValue, entrySet, get, get, get, getChild, getChildren, getDirtyChildren, getNonPhantomChild, getNonPhantomChildren, isEmpty, keySet, put, putAll, remove, values, visitChildren
areFlagsSet, clearFlags, getDirtyFlags, getObjectResolver, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValue, isComplex, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, iterator, moveTo, remove, removePhantomFlag, resolvePath, resolvePath, setFlags, setForceDirty, setIsModified, setReadOnly, setValue, setValue, size, toString, validateType
public Serializable getDefaultValue()
public Serializable internalGetValue() throws PropertyException
internalGetValue
in class ComplexProperty
PropertyException
public void internalSetValue(Serializable value) throws PropertyException
AbstractProperty
This applies only for nodes that physically store a value (that means non container nodes). Container nodes does nothing.
internalSetValue
in class MapProperty
PropertyException
public final Object clone() throws CloneNotSupportedException
clone
in class MapProperty
CloneNotSupportedException
public boolean isNormalized(Object value)
Property
Null values are considered as normalized.
isNormalized
in interface Property
isNormalized
in class ComplexProperty
value
- the value to checkpublic Serializable normalize(Object value) throws PropertyConversionException
Property
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.
normalize
in interface Property
normalize
in class ComplexProperty
value
- the value to normalize according to the property typePropertyConversionException
public <T> T convertTo(Serializable value, Class<T> toType) throws PropertyConversionException
Property
If the value has already the given type it will be returned back.
convertTo
in interface Property
convertTo
in class AbstractProperty
value
- the normalized value to converttoType
- the conversion typePropertyConversionException
- if the conversion cannot be made because of type incompatibilitiespublic Object newInstance()
Property
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 ""
newInstance
in interface Property
newInstance
in class AbstractProperty
public boolean isContainer()
Property
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.
isContainer
in interface Property
isContainer
in class MapProperty
public void setValue(Object value) throws PropertyException
Property
For complex or list properties the value will be set recursively (as a map or list value).
setValue
in interface Property
setValue
in class ComplexProperty
value
- the value to setPropertyException
public void init(Serializable value) throws PropertyException
Property
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.
init
in interface Property
init
in class ComplexProperty
value
- the normalized value to setPropertyException
public Serializable getValueForWrite() throws PropertyException
Property
Can be different fropm Property.getValue()
in cases where the property adapts the value it is given to store.
getValueForWrite
in interface Property
getValueForWrite
in class ComplexProperty
PropertyException
public boolean isSameAs(Property property) throws PropertyException
ComplexProperty
isSameAs
in interface Property
isSameAs
in class ComplexProperty
PropertyException
Copyright © 2015 Nuxeo SA. All rights reserved.