public class BinaryDataType extends AbstractLengthDataType<InputStream>
| Modifier and Type | Class and Description |
|---|---|
protected class |
BinaryDataType.MimeTypeRestriction |
AbstractLengthDataType.MaxRestriction, AbstractLengthDataType.MinRestrictionBasicDataType.AbstractRestriction<D extends Serializable>, BasicDataType.DataTypeComparator<D>, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction<D extends Serializable>, BasicDataType.TypeRestriction, BasicDataType.UniqueRestrictionDataType.Restriction<D extends Serializable>| Modifier and Type | Field and Description |
|---|---|
protected BinaryDataType.MimeTypeRestriction |
mimeTypeRestriction |
maxLengthRestriction, minLengthRestrictionDATATYPE_BUNDLE, defaultValue, enumerationRestriction, origin, requiredRestriction, typeRestriction, uniqueRestrictiondescription, guiName, keyENFORCE_ABSOLUTE, ENFORCE_ALWAYS, ENFORCE_NEVER, ENFORCE_ONCHANGE, ENFORCE_ONCREATE, ENFORCE_ONVALIDATE, PROCESS_GET, PROCESS_SET, VALID, XMLNS| Constructor and Description |
|---|
BinaryDataType(String name)
Constructor for binary field.
|
| Modifier and Type | Method and Description |
|---|---|
protected InputStream |
cast(Object value,
Cloud cloud,
Node node,
Field field)
Utility to avoid repetitive calling of getCloud
|
protected String |
castToPresent(Object value,
Node node,
Field field)
If the value must be shown, e.g.
|
protected void |
cloneRestrictions(BasicDataType origin)
If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.
|
long |
getLength(Object value)
In this method should be implemented how to calculate such a length for a certain value of
this datatype.
|
MimeType |
getMimeType(Object value,
Node node,
Field field) |
Pattern |
getValidMimeTypes()
Returns a regular expression which describes wich mime-types are valid for blobs with this
DataType.
|
void |
setValidMimeTypes(Pattern pattern) |
protected Collection<LocalizedString> |
validateCastValue(Collection<LocalizedString> errors,
Object castValue,
Object value,
Node node,
Field field) |
protected Collection<LocalizedString> |
validateRequired(Collection<LocalizedString> errors,
Object castValue,
Object value,
Node node,
Field field) |
getEnforceStrength, getMaxLength, getMaxLengthRestriction, getMinLength, getMinLengthRestriction, inheritRestrictions, setMaxLength, setMinLength, toStringBuilder, toXml, validateCastValueOrNulladdErrorDescription, addRestriction, addRestriction, addStyleClass, cast, castAndValidate, castForSearch, castToValidate, checkType, clone, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCloud, getCommitProcessor, getComparator, getDefaultProcessor, getDefaultValue, getDefaultValue, getDeleteProcessor, getElement, getElement, getEnforceString, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getProcessorWithoutDefault, getRequiredRestriction, getRestrictions, getStyleClasses, getTypeAsClass, getUniqueRestriction, hashCode, inherit, inheritProperties, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultProcessor, setDefaultValue, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate, xmlValuegetDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUINamefinalize, getClass, notify, notifyAll, wait, wait, waitcast, castAndValidate, castForSearch, checkType, clone, clone, finish, getBaseType, getBaseTypeIdentifier, getCommitProcessor, getDefaultValue, getDefaultValue, getDeleteProcessor, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getStyleClasses, getTypeAsClass, getUniqueRestriction, isFinished, isRequired, isUnique, preCast, rewrite, setCommitProcessor, setDefaultValue, setProcessor, setProcessor, setRequired, setUnique, toXml, validate, validategetDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUINamecompareToprotected BinaryDataType.MimeTypeRestriction mimeTypeRestriction
public BinaryDataType(String name)
name - the name of the data typeprotected String castToPresent(Object value, Node node, Field field)
BasicDataTypecastToPresent in class BasicDataType<InputStream>protected InputStream cast(Object value, Cloud cloud, Node node, Field field) throws CastException
BasicDataTypecast in class BasicDataType<InputStream>CastExceptionprotected void cloneRestrictions(BasicDataType origin)
BasicDataTypecloneRestrictions in class AbstractLengthDataType<InputStream>public long getLength(Object value)
AbstractLengthDataTypegetLength in interface LengthDataType<InputStream>getLength in class AbstractLengthDataType<InputStream>protected Collection<LocalizedString> validateRequired(Collection<LocalizedString> errors, Object castValue, Object value, Node node, Field field)
validateRequired in class BasicDataType<InputStream>protected Collection<LocalizedString> validateCastValue(Collection<LocalizedString> errors, Object castValue, Object value, Node node, Field field)
validateCastValue in class AbstractLengthDataType<InputStream>public Pattern getValidMimeTypes()
public void setValidMimeTypes(Pattern pattern)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}