Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.temp.shared.validators;

import com.temp.shared.*;
import com.temp.shared.externalization.*;

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);
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/shared/validators/RequiredValueValidator.java

Diff revisions: vs.
Revision Author Commited Message
600 Diff Diff GeorgeS picture GeorgeS Sun 05 Feb, 2012 18:55:58 +0000

Sync-n

595 GeorgeS picture GeorgeS Sat 21 Jan, 2012 16:54:12 +0000