public abstract class AbstractLengthDataType<E> extends BasicDataType<E> implements LengthDataType<E>
getLength(Object)) ,
and restrictions on that (minimal an maximal length).| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractLengthDataType.MaxRestriction |
protected static class |
AbstractLengthDataType.MinRestriction |
BasicDataType.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 AbstractLengthDataType.MaxRestriction |
maxLengthRestriction |
protected AbstractLengthDataType.MinRestriction |
minLengthRestriction |
DATATYPE_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 |
|---|
AbstractLengthDataType(String name,
Class<E> classType)
Constructor for big data field.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cloneRestrictions(BasicDataType<E> origin)
If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.
|
int |
getEnforceStrength()
The maximum enforce strength of all restrictions on this datatype.
|
abstract long |
getLength(Object value)
In this method should be implemented how to calculate such a length for a certain value of
this datatype.
|
long |
getMaxLength()
Returns the maximum length of values for this datatype.
|
DataType.Restriction<Long> |
getMaxLengthRestriction()
Returns the 'maxLength' restriction, containing the value, errormessages, and fixed status of this attribute.
|
long |
getMinLength()
Returns the minimum length of values for this datatype.
|
DataType.Restriction<Long> |
getMinLengthRestriction()
Returns the 'minLength' restriction, containing the value, errormessages, and fixed status of this attribute.
|
protected void |
inheritRestrictions(BasicDataType<E> origin)
If a datatype inherits from another datatype all its restrictions inherit too.
|
void |
setMaxLength(long value)
Sets the maximum length of binary values for this datatype.
|
void |
setMinLength(long value)
Sets the minimum length of binary values for this datatype.
|
protected StringBuilder |
toStringBuilder() |
void |
toXml(Element parent)
Fills this datatype in another XML (for example in the xml of
DataType.getOrigin(), to make one
XML, fully describing the DataType). |
protected Collection<LocalizedString> |
validateCastValue(Collection<LocalizedString> errors,
Object castValue,
Object value,
Node node,
Field field) |
protected Collection<LocalizedString> |
validateCastValueOrNull(Collection<LocalizedString> errors,
Object castValue,
Object value,
Node node,
Field field) |
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, cast, castAndValidate, castForSearch, castToPresent, 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, validateRequired, 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 AbstractLengthDataType.MinRestriction minLengthRestriction
protected AbstractLengthDataType.MaxRestriction maxLengthRestriction
protected void cloneRestrictions(BasicDataType<E> origin)
BasicDataTypecloneRestrictions in class BasicDataType<E>protected void inheritRestrictions(BasicDataType<E> origin)
BasicDataTypeinheritRestrictions in class BasicDataType<E>public abstract long getLength(Object value)
getLength in interface LengthDataType<E>public long getMinLength()
getMinLength in interface LengthDataType<E>int, or 0 if there is no minimum length.public DataType.Restriction<Long> getMinLengthRestriction()
getMinLengthRestriction in interface LengthDataType<E>DataType.Restrictionpublic void setMinLength(long value)
setMinLength in interface LengthDataType<E>value - the minimum length as an long, or 0 if there is no minimum length.public long getMaxLength()
getMaxLength in interface LengthDataType<E>long, or a very very big value
(Long.MAX_VALUE) if there is no maximum length.public DataType.Restriction<Long> getMaxLengthRestriction()
getMaxLengthRestriction in interface LengthDataType<E>DataType.Restrictionpublic void setMaxLength(long value)
setMaxLength in interface LengthDataType<E>value - the maximum length as an int, or -1 if there is no maximum length.Class<T> - Identifier: java.lang.UnsupportedOperationException if this datatype is finishedpublic int getEnforceStrength()
DataTypeDataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.getEnforceStrength in interface DataType<E>getEnforceStrength in class BasicDataType<E>protected Collection<LocalizedString> validateCastValueOrNull(Collection<LocalizedString> errors, Object castValue, Object value, Node node, Field field)
validateCastValueOrNull in class BasicDataType<E>protected Collection<LocalizedString> validateCastValue(Collection<LocalizedString> errors, Object castValue, Object value, Node node, Field field)
validateCastValue in class BasicDataType<E>public void toXml(Element parent)
DataTypeDataType.getOrigin(), to make one
XML, fully describing the DataType). The implementation of this method is
unfinished!protected StringBuilder toStringBuilder()
toStringBuilder in class BasicDataType<E>MMBase 1.9-SNAPSHOT - ${javadoctimestamp}