|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.validation.FieldConstraint
velosurf.validation.Length
public class Length
A string length constraint. Syntax is:
<column min-len="min" max-len="max"/>
where you donnot need to specify both min-len and max-len.
Or:
<column>
<min-len value="min-value" [message="error-message"]>
<max-len value="max-value" [message="error-message"]>
</column>
Note: this constraint is not meant to replace an internal SQL constraint in the database, since it cannot be made sure that complex updates will respect this constraint.
| Field Summary | |
|---|---|
private int |
maxLen
max length. |
private int |
minLen
min lmength. |
| Constructor Summary | |
|---|---|
Length(int minLen,
int maxLen)
Constructor. |
|
| Method Summary | |
|---|---|
void |
setMaxLength(int maxLen)
Maximum length setter. |
void |
setMinLength(int minLen)
Min length setter. |
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 int minLen
private int maxLen
| Constructor Detail |
|---|
public Length(int minLen,
int maxLen)
minLen - the minimum length allowed (inclusive)maxLen - the maximum length allowed (inclusive)| Method Detail |
|---|
public void setMinLength(int minLen)
minLen - minimum lengthpublic void setMaxLength(int maxLen)
maxLen - maximum lengthpublic boolean validate(java.lang.Object data)
validate in class FieldConstraintdata - data to validate
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 | |||||||||