velosurf.validation
Class NotNull
java.lang.Object
velosurf.validation.FieldConstraint
velosurf.validation.NotNull
public class NotNull
- extends FieldConstraint
A "not null" constraint. Syntax is:
<column not-null="true"/>
Or:
<column>
<not-null [message="error-message"]/>
</column>
To validate data coming from an HTML form, you should rather use the not-empty constraint since there cannot
be any null value.
Note: this constraint is not meant to replace an internal SQL "not-null" clause in the database,
since it cannot be made sure that complex updates will respect this constraint.
- Author:
- Claude Brisson
|
Constructor Summary |
NotNull()
Default constructor. |
|
Method Summary |
java.lang.String |
toString()
|
boolean |
validate(java.lang.Object data)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NotNull
public NotNull()
- Default constructor.
validate
public boolean validate(java.lang.Object data)
- Overrides:
validate in class FieldConstraint
- Parameters:
data - the data to be validated
- Returns:
- true if data is not null
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
~ooOoo~