|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.core.AbstractDescriptor
org.mmbase.datatypes.BasicDataType<E>
org.mmbase.datatypes.AbstractLengthDataType<E>
public abstract class AbstractLengthDataType<E>
A LengthDataType is a datatype that defines a length for its values (getLength(Object)) ,
and restrictions on that (minimal an maximal length).
| Nested Class Summary | |
|---|---|
protected static class |
AbstractLengthDataType.MaxRestriction
|
protected static class |
AbstractLengthDataType.MinRestriction
|
| Nested classes/interfaces inherited from class org.mmbase.datatypes.BasicDataType |
|---|
BasicDataType.AbstractRestriction<D extends Serializable>, BasicDataType.DataTypeComparator<D>, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction<D extends Serializable>, BasicDataType.TypeRestriction, BasicDataType.UniqueRestriction |
| Nested classes/interfaces inherited from interface org.mmbase.datatypes.DataType |
|---|
DataType.Restriction<D extends Serializable> |
| Field Summary | |
|---|---|
protected AbstractLengthDataType.MaxRestriction |
maxLengthRestriction
|
protected AbstractLengthDataType.MinRestriction |
minLengthRestriction
|
| Fields inherited from class org.mmbase.datatypes.BasicDataType |
|---|
DATATYPE_BUNDLE, defaultValue, enumerationRestriction, origin, requiredRestriction, typeRestriction, uniqueRestriction |
| Fields inherited from class org.mmbase.core.AbstractDescriptor |
|---|
description, guiName, key |
| Fields inherited from interface org.mmbase.datatypes.DataType |
|---|
ENFORCE_ABSOLUTE, ENFORCE_ALWAYS, ENFORCE_NEVER, ENFORCE_ONCHANGE, ENFORCE_ONCREATE, ENFORCE_ONVALIDATE, PROCESS_GET, PROCESS_SET, VALID, XMLNS |
| Constructor Summary | |
|---|---|
AbstractLengthDataType(String name,
Class<E> classType)
Constructor for big data field. |
|
| Method Summary | |
|---|---|
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)
|
| 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 class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mmbase.datatypes.DataType |
|---|
cast, castAndValidate, castForSearch, castOrException, 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, validate |
| Methods inherited from interface org.mmbase.bridge.Descriptor |
|---|
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected AbstractLengthDataType.MinRestriction minLengthRestriction
protected AbstractLengthDataType.MaxRestriction maxLengthRestriction
| Constructor Detail |
|---|
public AbstractLengthDataType(String name,
Class<E> classType)
name - the name of the data typeclassType - the class of the data type's possible value| Method Detail |
|---|
protected void cloneRestrictions(BasicDataType<E> origin)
BasicDataType
cloneRestrictions in class BasicDataType<E>protected void inheritRestrictions(BasicDataType<E> origin)
BasicDataType
inheritRestrictions 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!
toXml in interface DataType<E>toXml in class BasicDataType<E>parent - a 'datatype' element.protected StringBuilder toStringBuilder()
toStringBuilder in class BasicDataType<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||