|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.validation.FieldConstraint
velosurf.validation.OneOf
public class OneOf
An enumeration constraint. Syntax is:
<column one-of="value1,value2,value3..."/>
Or:
<column>
<one-of [message="error-message"]>
<value>value1</value>
<value>value2</value>
<value>value3</value>
...
</one-of>
</column>
Note: this constraint is not meant to replace an internal SQL enumeration constraint clause in the database, since it cannot be made sure that complex updates will respect this constraint.
| Field Summary | |
|---|---|
private java.util.List |
values
|
| Constructor Summary | |
|---|---|
OneOf(java.util.List values)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
toString()
return a string representation for this constraint. |
boolean |
validate(java.lang.Object data)
Validate data against this constraint. |
| Methods inherited from class velosurf.validation.FieldConstraint |
|---|
getMessage, setMessage, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.List values
| Constructor Detail |
|---|
public OneOf(java.util.List values)
values - the list of possible values| Method Detail |
|---|
public boolean validate(java.lang.Object data)
validate in class FieldConstraintdata - the data to be validated
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||