|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
D - Type of Value describing the restrictionpublic static interface DataType.Restriction<D extends Serializable>
A restriction controls (one aspect of) the acceptable values of a DataType. A DataType generally has several restrictions.
| Method Summary | |
|---|---|
int |
getEnforceStrength()
See DataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER. |
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. |
| Method Detail |
|---|
String getName()
D getValue()
void setValue(D value)
value - The instanc for the ValueLocalizedString getErrorDescription()
void setErrorDescription(LocalizedString errorDescription)
errorDescription - description of error
boolean 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()
DataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.
void setEnforceStrength(int v)
v - value of DataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||