public class ExternalBlobProperty extends MapProperty
Create/edit from a blob is not handled, and the blob uri cannot be retrieved from the blob (no api for now).
| Modifier and Type | Field and Description |
|---|---|
static String |
DIGEST |
static String |
ENCODING |
static String |
FILE_NAME |
static String |
LENGTH |
static String |
MIME_TYPE |
static String |
URI |
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 |
|---|
ExternalBlobProperty(Property parent,
Field field) |
ExternalBlobProperty(Property parent,
Field field,
int flags) |
| Modifier and Type | Method and Description |
|---|---|
static Blob |
getBlobFromMap(Map<String,Object> mapValue) |
static Map<String,Serializable> |
getMapFromBlob(Blob blob) |
Map<String,Serializable> |
getMapFromBlobWithUri(Blob blob) |
<T> T |
getValue(Class<T> type)
Gets the property value as the given type.
|
Serializable |
getValueForWrite()
Gets the property normalized value for write.
|
void |
init(Serializable value)
Initializes the property with the given normalized value.
|
Serializable |
internalGetValue() |
protected boolean |
isSameValue(Serializable value1,
Serializable value2) |
void |
setValue(Object value)
Overridden to be able to set a blob from a given map.
|
accept, clone, getField, getName, getType, internalSetValue, isContaineraddEmpty, addValue, addValue, clear, clearDirtyFlags, containsKey, containsValue, entrySet, get, get, get, getChild, getChildren, getDefaultValue, getDirtyChildren, getNonPhantomChild, getNonPhantomChildren, internalGetChild, isEmpty, isNormalized, isSameAs, keySet, normalize, put, putAll, remove, values, visitChildrenappendDirtyFlags, areFlagsSet, clearFlags, collectPath, computeRemovedProperty, convertTo, getDeprecatedParent, getDirtyFlags, getObjectResolver, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValueDeprecation, getXPath, getXPath, isComplex, isDeprecated, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, iterator, moveTo, newDeprecatedMessage, newInstance, 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, spliteratorpublic static final String ENCODING
public static final String MIME_TYPE
public static final String FILE_NAME
public static final String DIGEST
public static final String LENGTH
public static final String URI
public ExternalBlobProperty(Property parent, Field field, int flags)
public ExternalBlobProperty(Property parent, Field field)
public 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 internalGetValue() throws PropertyException
internalGetValue in class ComplexPropertyPropertyExceptionpublic <T> T getValue(Class<T> type) throws PropertyException
PropertyThe value is converted using the registered converter to the given type.
If conversion is not supported a runtime exception will be triggered.
getValue in interface PropertygetValue in class AbstractPropertyPropertyExceptionpublic 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 ComplexPropertyPropertyExceptionpublic void setValue(Object value) throws PropertyException
Take care of not overriding the uri if set as this information is not on the blob.
setValue in interface PropertysetValue in class ComplexPropertyvalue - the value to setPropertyException - if one of the sub properties throws an exception or if trying to set values to a blob
without any already existing uri set.protected boolean isSameValue(Serializable value1, Serializable value2)
isSameValue in class AbstractPropertypublic static Blob getBlobFromMap(Map<String,Object> mapValue)
public Map<String,Serializable> getMapFromBlobWithUri(Blob blob) throws PropertyException
PropertyExceptionpublic static Map<String,Serializable> getMapFromBlob(Blob blob)
Copyright © 2018 Nuxeo. All rights reserved.