D - Type of Value describing the restrictionpublic static interface DataType.Restriction<D extends Serializable> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
int |
getEnforceStrength()
|
LocalizedString |
getErrorDescription()
If the restriction does not hold, the following error description can be used.
|
String |
getName() |
D |
getValue()
A Value describing the restriction, so depending on the semantics of this restriction, it
can have virtually every type (as long as it is Serializable)
|
void |
setEnforceStrength(int v)
Set enforce strength
|
void |
setErrorDescription(LocalizedString errorDescription)
Set error description for this restriction
|
void |
setFixed(boolean fixed)
If a restriction is 'fixed', the value and error-description cannot be changed any more.
|
void |
setValue(D value)
Set the Value describing the restriction
|
boolean |
valid(Object value,
Node node,
Field field)
This function should contain the actual logic of the restriction.
|
String getName()
D getValue()
void setValue(D value)
value - The instanc for the ValueLocalizedString getErrorDescription()
void setErrorDescription(LocalizedString errorDescription)
errorDescription - description of errorboolean valid(Object value, Node node, Field field)
value - The value to check the restriction fornode - Some constrainst may need the Node.field - Some constrainst may need the Field.void setFixed(boolean fixed)
fixed - int getEnforceStrength()
void setEnforceStrength(int v)
v - value of DataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}