org.mmbase.datatypes
Class BinaryStringDataType
java.lang.Object
org.mmbase.core.AbstractDescriptor
org.mmbase.datatypes.BasicDataType<E>
org.mmbase.datatypes.ComparableDataType<String>
org.mmbase.datatypes.StringDataType
org.mmbase.datatypes.BinaryStringDataType
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<DataType<String>>, Descriptor, DataType<String>, LengthDataType<String>, PublicCloneable<AbstractDescriptor>
public class BinaryStringDataType
- extends StringDataType
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
|
Method Summary |
protected String |
cast(Object value,
Cloud cloud,
Node node,
Field field)
Utility to avoid repetitive calling of getCloud |
protected String |
castForPattern(Object v,
Node node,
Field field)
|
String |
castForSearch(Object value,
Node node,
Field field)
Sometimes the the representation of the value is a bit different in the database, or has a
different type. |
protected String |
castToPresent(Object value,
Node node,
Field field)
If the value must be shown, e.g. |
protected Object |
castToValidate(Object value,
Node node,
Field field)
Before validating the value, the value will be 'cast', on default this will be to the
'correct' type, but it can be a more generic type sometimes. |
long |
getLength(Object value)
In this method should be implemented how to calculate such a length for a certain value of
this datatype. |
protected Collection<LocalizedString> |
validateRequired(Collection<LocalizedString> errors,
Object castValue,
Object value,
Node node,
Field field)
|
| Methods inherited from class org.mmbase.datatypes.StringDataType |
clone, cloneRestrictions, compare, first, getCollator, getComparator, getEnforceStrength, getMaxLength, getMaxLengthRestriction, getMinLength, getMinLengthRestriction, getPattern, getPatternRestriction, inheritProperties, inheritRestrictions, isPassword, main, setCollator, setMaxLength, setMinLength, setPassword, setPattern, toStringBuilder, toXml, validateCastValue, validateCastValueOrNull |
| Methods inherited from class org.mmbase.datatypes.BasicDataType |
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, castAndValidate, castOrException, checkType, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCloud, getCommitProcessor, getDefaultProcessor, getDefaultValue, getDeleteProcessor, getElement, getElement, getEnforceString, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getProcessorWithoutDefault, getRequiredRestriction, getRestrictions, getStyleClasses, getTypeAsClass, getUniqueRestriction, hashCode, inherit, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultProcessor, setDefaultValue, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate, xmlValue |
| Methods inherited from class org.mmbase.core.AbstractDescriptor |
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName |
| Methods inherited from interface org.mmbase.datatypes.DataType |
cast, castAndValidate, castOrException, checkType, 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, validate |
| Methods inherited from interface org.mmbase.bridge.Descriptor |
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName |
BinaryStringDataType
public BinaryStringDataType(String name)
getLength
public long getLength(Object value)
- Description copied from interface:
LengthDataType
- In this method should be implemented how to calculate such a length for a certain value of
this datatype. There does not exist a generic interface for this, so the implementation
will cast to the expected type (String, byte[]..)
- Specified by:
getLength in interface LengthDataType<String>- Overrides:
getLength in class StringDataType
castToValidate
protected Object castToValidate(Object value,
Node node,
Field field)
throws CastException
- Description copied from class:
BasicDataType
- Before validating the value, the value will be 'cast', on default this will be to the
'correct' type, but it can be a more generic type sometimes. E.g. for numbers this wil simply
cast to Number.
- Overrides:
castToValidate in class BasicDataType<String>
- Throws:
CastException
castToPresent
protected String castToPresent(Object value,
Node node,
Field field)
- Description copied from class:
BasicDataType
- If the value must be shown, e.g. in error message, it passed through this method.
- Overrides:
castToPresent in class BasicDataType<String>
castForPattern
protected String castForPattern(Object v,
Node node,
Field field)
- Overrides:
castForPattern in class StringDataType
cast
protected String cast(Object value,
Cloud cloud,
Node node,
Field field)
throws CastException
- Description copied from class:
BasicDataType
- Utility to avoid repetitive calling of getCloud
- Overrides:
cast in class BasicDataType<String>
- Throws:
CastException
validateRequired
protected Collection<LocalizedString> validateRequired(Collection<LocalizedString> errors,
Object castValue,
Object value,
Node node,
Field field)
- Overrides:
validateRequired in class BasicDataType<String>
castForSearch
public String castForSearch(Object value,
Node node,
Field field)
- Description copied from interface:
DataType
- Sometimes the the representation of the value is a bit different in the database, or has a
different type. So when constraining a search on the value, casting is done by this. This may
default to
DataType.cast(Object, Node, Field).
- Specified by:
castForSearch in interface DataType<String>- Overrides:
castForSearch in class BasicDataType<String>
MMBase 2.0-SNAPSHOT - null