public abstract class ComparableDataType<E extends Serializable & Comparable<E>> extends BasicDataType<E>
Comparable, so can be ordered, and
therefore can have a minimum and a maximum value.| Modifier and Type | Class and Description |
|---|---|
protected class |
ComparableDataType.MaxRestriction |
protected class |
ComparableDataType.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 ComparableDataType.MaxRestriction |
maxRestriction |
protected ComparableDataType.MinRestriction |
minRestriction |
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| Modifier | Constructor and Description |
|---|---|
protected |
ComparableDataType(String name,
Class<E> classType) |
| Modifier and Type | Method and Description |
|---|---|
ComparableDataType<E> |
clone(String name)
Returns a cloned instance of this datatype, inheriting all validation rules.
|
protected void |
cloneRestrictions(BasicDataType<E> origin)
If a datatype is cloned, the restrictions of it (normally implemented as inner classes), must be reinstantiated.
|
protected int |
compare(E comp1,
E comp2) |
Comparator<E> |
getComparator() |
E |
getDefaultValue(Locale locale,
Cloud cloud,
Field field)
Returns the (locale dependent) default value of this data type,
|
int |
getEnforceStrength()
The maximum enforce strength of all restrictions on this datatype.
|
DataType.Restriction<E> |
getMaxRestriction() |
DataType.Restriction<E> |
getMinRestriction() |
protected void |
inheritRestrictions(BasicDataType<E> origin)
If a datatype inherits from another datatype all its restrictions inherit too.
|
boolean |
isMaxInclusive()
Returns whether the maximum value for this data type is inclusive or not.
|
boolean |
isMinInclusive()
Returns whether the minimum value for this data type is inclusive or not.
|
void |
setMax(E value,
boolean inclusive)
Sets the maximum Date value for this data type.
|
void |
setMin(E value,
boolean inclusive)
Sets the minimum Date value for this data type.
|
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) |
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, cast, castAndValidate, castForSearch, castToPresent, castToValidate, 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, inheritProperties, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultProcessor, setDefaultValue, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate, validateCastValueOrNull, validateRequired, xmlValuegetDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUINamefinalize, getClass, notify, notifyAll, wait, wait, waitgetDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUINameprotected ComparableDataType.MinRestriction minRestriction
protected ComparableDataType.MaxRestriction maxRestriction
protected void inheritRestrictions(BasicDataType<E> origin)
BasicDataTypeinheritRestrictions in class BasicDataType<E extends Serializable & Comparable<E>>protected void cloneRestrictions(BasicDataType<E> origin)
BasicDataTypecloneRestrictions in class BasicDataType<E extends Serializable & Comparable<E>>public DataType.Restriction<E> getMinRestriction()
public boolean isMinInclusive()
true if the minimum value if inclusive, false if it is not, or if there is no minimum.public DataType.Restriction<E> getMaxRestriction()
public boolean isMaxInclusive()
true if the maximum value if inclusive, false if it is not, or if there is no minimum.public E getDefaultValue(Locale locale, Cloud cloud, Field field)
BasicDataTypegetDefaultValue in interface DataType<E extends Serializable & Comparable<E>>getDefaultValue in class BasicDataType<E extends Serializable & Comparable<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 extends Serializable & Comparable<E>>toXml in class BasicDataType<E extends Serializable & Comparable<E>>parent - a 'datatype' element.public void setMin(E value, boolean inclusive)
public void setMax(E value, boolean inclusive)
public int getEnforceStrength()
DataTypeDataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.getEnforceStrength in interface DataType<E extends Serializable & Comparable<E>>getEnforceStrength in class BasicDataType<E extends Serializable & Comparable<E>>protected Collection<LocalizedString> validateCastValue(Collection<LocalizedString> errors, Object castValue, Object value, Node node, Field field)
validateCastValue in class BasicDataType<E extends Serializable & Comparable<E>>public ComparableDataType<E> clone(String name)
BasicDataTypeBasicDataType.inheritProperties(BasicDataType) and BasicDataType.cloneRestrictions(BasicDataType). A clone is not finished. See BasicDataType.isFinished().clone in interface DataType<E extends Serializable & Comparable<E>>clone in class BasicDataType<E extends Serializable & Comparable<E>>name - the new name of the copied datatype (can be null, in which case the name is not changed).protected StringBuilder toStringBuilder()
toStringBuilder in class BasicDataType<E extends Serializable & Comparable<E>>public Comparator<E> getComparator()
getComparator in class BasicDataType<E extends Serializable & Comparable<E>>MMBase 1.9-SNAPSHOT - ${javadoctimestamp}