|
||||||||||
| 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
org.mmbase.datatypes.ComparableDataType
org.mmbase.datatypes.StringDataType
The datatype for String fields. Strings can be constrained by a regular expression, and have a property 'password' which indicates that the contents should not be shown.
| Nested Class Summary | |
protected class |
StringDataType.PatternRestriction
|
| Nested classes inherited from class org.mmbase.datatypes.ComparableDataType |
ComparableDataType.MaxRestriction, ComparableDataType.MinRestriction |
| Nested classes inherited from class org.mmbase.datatypes.BasicDataType |
BasicDataType.AbstractRestriction, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction, BasicDataType.TypeRestriction, BasicDataType.UniqueRestriction |
| Nested classes inherited from class org.mmbase.datatypes.DataType |
DataType.Restriction |
| Field Summary | |
static Pattern |
BOOLEAN_PATTERN
|
static Pattern |
DOUBLE_PATTERN
|
static Pattern |
INTEGER_PATTERN
|
static Pattern |
LONG_PATTERN
|
protected org.mmbase.datatypes.AbstractLengthDataType.MaxRestriction |
maxLengthRestriction
|
protected org.mmbase.datatypes.AbstractLengthDataType.MinRestriction |
minLengthRestriction
|
static Pattern |
NON_NEGATIVE_INTEGER_PATTERN
|
protected StringDataType.PatternRestriction |
patternRestriction
|
| Fields inherited from class org.mmbase.datatypes.ComparableDataType |
maxRestriction, minRestriction |
| Fields inherited from class org.mmbase.datatypes.BasicDataType |
DATATYPE_BUNDLE, 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, PROCESS_GET, PROCESS_SET, VALID, XMLNS |
| Constructor Summary | |
StringDataType(String name)
Constructor for string data type. |
|
| Method Summary | |
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. |
long |
getMaxLength()
Returns the maximum length of binary values for this datatype. |
DataType.Restriction |
getMaxLengthRestriction()
Returns the 'maxLength' restriction, containing the value, errormessages, and fixed status of this attribute. |
long |
getMinLength()
Returns the minimum length of binary values for this datatype. |
DataType.Restriction |
getMinLengthRestriction()
Returns the 'minLength' restriction, containing the value, errormessages, and fixed status of this attribute. |
Pattern |
getPattern()
Returns the regular expression pattern used to validate values for this datatype. |
DataType.Restriction |
getPatternRestriction()
Returns the 'pattern' restriction, containing the value, error messages, and fixed status of this attribute. |
protected void |
inheritProperties(BasicDataType origin)
Properties are members of the datatype that can easily be copied/clones. |
protected void |
inheritRestrictions(BasicDataType origin)
If a datatype inherits from another datatype all its restrictions inherit too. |
boolean |
isPassword()
Whether or not the data represents sensitive information, in which case e.g. |
static void |
main(String[] argv)
|
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. |
void |
setPassword(boolean pw)
|
void |
setPattern(Pattern value)
Sets the regular expression pattern used to validate values for this datatype. |
protected StringBuffer |
toStringBuffer()
|
void |
toXml(Element parent)
Fills this datatype in another XML (for example in the xml of BasicDataType.getOrigin(), to make one XML, fully describing the DataType). |
protected Collection |
validateCastedValue(Collection errors,
Object castedValue,
Object value,
Node node,
Field field)
|
| Methods inherited from class org.mmbase.datatypes.ComparableDataType |
clone, getDefaultValue, getMaxRestriction, getMinRestriction, isMaxInclusive, isMinInclusive, setMax, setMin |
| Methods inherited from class org.mmbase.datatypes.BasicDataType |
cast, cast, castToValidate, checkType, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCommitProcessor, getElement, getElement, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getTypeAsClass, getUniqueRestriction, hashCode, inherit, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultValue, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate |
| 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, checkType, clone, clone, finish, getBaseType, getBaseTypeIdentifier, getCommitProcessor, getDefaultValue, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getTypeAsClass, getUniqueRestriction, inherit, 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 StringDataType.PatternRestriction patternRestriction
protected org.mmbase.datatypes.AbstractLengthDataType.MinRestriction minLengthRestriction
protected org.mmbase.datatypes.AbstractLengthDataType.MaxRestriction maxLengthRestriction
public static final Pattern DOUBLE_PATTERN
public static final Pattern BOOLEAN_PATTERN
public static final Pattern INTEGER_PATTERN
public static final Pattern NON_NEGATIVE_INTEGER_PATTERN
public static final Pattern LONG_PATTERN
| Constructor Detail |
public StringDataType(String name)
name - the name of the data type| Method Detail |
protected void inheritProperties(BasicDataType origin)
BasicDataType
inheritProperties in class BasicDataTypeprotected void inheritRestrictions(BasicDataType origin)
BasicDataType
inheritRestrictions in class ComparableDataTypeprotected void cloneRestrictions(BasicDataType origin)
BasicDataType
cloneRestrictions in class ComparableDataTypepublic long getLength(Object value)
LengthDataType
getLength in interface LengthDataTypepublic long getMinLength()
getMinLength in interface LengthDataTypeint, or 0 if there is no minimum length.public DataType.Restriction getMinLengthRestriction()
getMinLengthRestriction in interface LengthDataTypeDataType.Restrictionpublic void setMinLength(long value)
setMinLength in interface LengthDataTypevalue - the minimum length as an long, or 0 if there is no minimum length.public long getMaxLength()
getMaxLength in interface LengthDataTypelong, or a very very big value
(Long.MAX_VALUE) if there is no maximum length.public DataType.Restriction getMaxLengthRestriction()
getMaxLengthRestriction in interface LengthDataTypeDataType.Restrictionpublic void setMaxLength(long value)
setMaxLength in interface LengthDataTypevalue - see LengthDataType.getMaxLength()public Pattern getPattern()
public DataType.Restriction getPatternRestriction()
DataType.Restrictionpublic void setPattern(Pattern value)
value - the pattern as a Pattern, or null if no pattern should be applied.
UnsupportedOperationException - if this datatype is read-only (i.e. defined by MMBase)public boolean isPassword()
public void setPassword(boolean pw)
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 DataTypetoXml in class ComparableDataType
protected Collection validateCastedValue(Collection errors,
Object castedValue,
Object value,
Node node,
Field field)
validateCastedValue in class ComparableDataTypeprotected StringBuffer toStringBuffer()
toStringBuffer in class ComparableDataTypepublic static void main(String[] argv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||