public class BlobProperty extends MapProperty
Blob object.| Modifier and Type | Class and Description |
|---|---|
static class |
BlobProperty.ScalarMemberProperty |
| Modifier and Type | Field and Description |
|---|---|
protected Serializable |
value |
fieldchildrendeprecatedFallback, flags, forceDirty, IS_READONLY, isDeprecated, NON_CANON_INDEX, parentDIRTY_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() |
protected Object |
getMemberValue(Object object,
String name) |
Serializable |
getValueForWrite()
Gets the property normalized value for write.
|
void |
init(Serializable value)
Initializes the property with the given normalized value.
|
protected Property |
internalGetChild(Field field)
Gets the property given its name.
|
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.
|
protected boolean |
isSameValue(Serializable value1,
Serializable value2) |
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.
|
protected void |
setMap(Object object,
Map<String,Object> value) |
protected void |
setMemberValue(Blob blob,
String name,
Object value) |
protected void |
setMemberValue(Object object,
String name,
Object value) |
void |
setValue(Object value)
Sets this property value.
|
accept, getField, getName, getTypeaddEmpty, addValue, addValue, clear, clearDirtyFlags, containsKey, containsValue, entrySet, get, get, get, getChild, getChildren, getDirtyChildren, getNonPhantomChild, getNonPhantomChildren, isEmpty, keySet, put, putAll, remove, values, visitChildrenappendDirtyFlags, areFlagsSet, clearFlags, collectPath, computeRemovedProperty, getDeprecatedParent, getDirtyFlags, getObjectResolver, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValue, getValueDeprecation, getXPath, getXPath, isComplex, isDeprecated, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, iterator, moveTo, newDeprecatedMessage, remove, removePhantomFlag, resolvePath, resolvePath, setDirtyFlags, setFlags, setForceDirty, setIsModified, setIsMoved, setIsNew, setIsRemoved, setReadOnly, setValue, setValue, setValueDeprecation, size, toString, validateTypeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, sizeforEach, spliteratorprotected Serializable value
public BlobProperty(Property parent, Field field, int flags)
public Serializable getDefaultValue()
getDefaultValue in class ComplexPropertypublic Serializable internalGetValue() throws PropertyException
internalGetValue in class ComplexPropertyPropertyExceptionpublic void internalSetValue(Serializable value) throws PropertyException
AbstractPropertyThis applies only for nodes that physically store a value (that means non container nodes). Container nodes does nothing.
internalSetValue in class MapPropertyPropertyExceptionpublic final Object clone() throws CloneNotSupportedException
clone in class MapPropertyCloneNotSupportedExceptionpublic boolean isNormalized(Object value)
PropertyNull values are considered as normalized.
isNormalized in interface PropertyisNormalized in class ComplexPropertyvalue - the value to checkpublic Serializable normalize(Object value) throws PropertyConversionException
PropertyNormalized 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 Propertynormalize in class ComplexPropertyvalue - the value to normalize according to the property typePropertyConversionExceptionpublic <T> T convertTo(Serializable value, Class<T> toType) throws PropertyConversionException
PropertyIf the value has already the given type it will be returned back.
convertTo in interface PropertyconvertTo in class AbstractPropertyvalue - 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 PropertynewInstance in class AbstractPropertypublic 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 PropertyisContainer in class MapPropertypublic void setValue(Object value) throws PropertyException
PropertyFor complex or list properties the value will be set recursively (as a map or list value).
setValue in interface PropertysetValue in class ComplexPropertyvalue - the value to setPropertyExceptionprotected boolean isSameValue(Serializable value1, Serializable value2)
isSameValue in class AbstractPropertypublic void init(Serializable value) throws PropertyException
PropertyThe 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 Propertyinit in class ComplexPropertyvalue - the normalized value to setPropertyExceptionpublic 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 PropertygetValueForWrite in class ComplexPropertyPropertyExceptionprotected Property internalGetChild(Field field)
ComplexPropertyThis method will always be called using a valid property name (a property specified by the schema). The returned property will be cached by its parent so the next time it is needed, it will be reused from the cache. That means this method servers as a initializer for properties - usually you create a new property and return it - you don't need to cache created properties.
If you want to change the way a property is fetched / stored, you must override this method.
internalGetChild in class ComplexPropertyprotected void setMap(Object object, Map<String,Object> value) throws PropertyException
PropertyExceptionprotected void setMemberValue(Blob blob, String name, Object value) throws PropertyNotFoundException
PropertyNotFoundExceptionprotected Object getMemberValue(Object object, String name) throws PropertyException
PropertyExceptionprotected void setMemberValue(Object object, String name, Object value) throws PropertyException
PropertyExceptionpublic boolean isSameAs(Property property) throws PropertyException
ComplexPropertyisSameAs in interface PropertyisSameAs in class ComplexPropertyPropertyExceptionPropertyExceptionCopyright © 2018 Nuxeo. All rights reserved.