Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/GWT_Sandbox/FormEngine/src/com/temp/shared/validators/RequiredValueValidator.java

Diff revisions: vs.
  @@ -1,24 +1,24 @@
1 - package com.temp.shared.validators;
2 -
3 - import org.litesoft.core.util.externalization.*;
4 -
5 - import com.temp.shared.*;
6 -
7 - public class RequiredValueValidator implements ValueValidator {
8 - public static final String TEMPLATE_ID_CODE = "Required";
9 -
10 - public static final ValueValidator INSTANCE = new RequiredValueValidator();
11 -
12 - private RequiredValueValidator() {
13 - }
14 -
15 - @Override
16 - public E13nData checkValue( Object value ) {
17 - if ( value != null ) {
18 - if ( !(value instanceof String) || (((String) value).trim().length() != 0) ) {
19 - return null; // !null && (!String || String ! Empty)
20 - }
21 - }
22 - return new E13nData( TEMPLATE_ID_CODE );
23 - }
24 - }
1 + package com.temp.shared.validators;
2 +
3 + import org.litesoft.core.util.externalization.*;
4 +
5 + import com.temp.shared.*;
6 +
7 + public class RequiredValueValidator implements ValueValidator {
8 + public static final String TEMPLATE_ID_CODE = "Required";
9 +
10 + public static final ValueValidator INSTANCE = new RequiredValueValidator();
11 +
12 + private RequiredValueValidator() {
13 + }
14 +
15 + @Override
16 + public E13nData checkValue( Object value ) {
17 + if ( value != null ) {
18 + if ( !(value instanceof String) || (((String) value).trim().length() != 0) ) {
19 + return null; // !null && (!String || String ! Empty)
20 + }
21 + }
22 + return new E13nData( TEMPLATE_ID_CODE );
23 + }
24 + }