litesoft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package com.temp.shared.validators;
import com.temp.shared.*;
public class RequiredValueValidator implements ValueValidator {
public static final String TEMPLATE_ID_CODE = "Required";
public static final ValueValidator INSTANCE = new RequiredValueValidator();
private RequiredValueValidator() {
}
@Override
public E13nData checkValue(Object value) {
if (value != null) {
if (!(value instanceof String) || (((String) value).trim().length() != 0)) {
return null; // !null && (!String || String ! Empty)
}
}
return new E13nData(TEMPLATE_ID_CODE);
}
}
|
Revision |
Author |
Commited |
Message |
595
|
GeorgeS
|
Sat 21 Jan, 2012 16:54:12 +0000 |
|