|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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()
|
Serializable |
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)
|
void |
setErrorDescription(LocalizedString errorDescription)
|
void |
setFixed(boolean fixed)
If a restriction is 'fixed', the value and error-description cannot be changed any more. |
void |
setValue(Serializable value)
|
boolean |
valid(Object value,
Node node,
Field field)
This function should contain the actual logic of the restriction. |
| Method Detail |
public String getName()
public Serializable getValue()
public void setValue(Serializable value)
public LocalizedString getErrorDescription()
public void setErrorDescription(LocalizedString errorDescription)
public 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.
public void setFixed(boolean fixed)
public int getEnforceStrength()
DataType.ENFORCE_ALWAYS, DataType.ENFORCE_ONCHANGE, DataType.ENFORCE_NEVER.
public void setEnforceStrength(int v)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||