-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.validation.annotation;\r
-\r
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;\r
-import static java.lang.annotation.ElementType.FIELD;\r
-import static java.lang.annotation.ElementType.METHOD;\r
-import static java.lang.annotation.ElementType.TYPE;\r
-import static java.lang.annotation.RetentionPolicy.RUNTIME;\r
-\r
-import java.lang.annotation.Documented;\r
-import java.lang.annotation.Retention;\r
-import java.lang.annotation.Target;\r
-\r
-import javax.validation.Constraint;\r
-import javax.validation.Payload;\r
-\r
-import eu.etaxonomy.cdm.validation.constraint.ReferenceCheckValidator;\r
-\r
-\r
-@Target( { TYPE, METHOD, FIELD, ANNOTATION_TYPE})\r
-@Retention(RUNTIME)\r
-@Constraint(validatedBy = ReferenceCheckValidator.class)\r
-@Documented\r
-public @interface ReferenceCheck {\r
-\r
- String message() default "{eu.etaxonomy.cdm.validation.annotation.InReference.ReferenceShouldNotHaveIsbn.message}";\r
-\r
- Class<? extends Payload>[] payload() default {};\r
-\r
- Class<?>[] groups() default {}; //Level2.class\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.validation.annotation;
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+
+import eu.etaxonomy.cdm.validation.constraint.ReferenceCheckValidator;
+
+
+@Target( { TYPE, METHOD, FIELD, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+@Constraint(validatedBy = ReferenceCheckValidator.class)
+@Documented
+public @interface ReferenceCheck {
+
+ String message() default "{eu.etaxonomy.cdm.validation.annotation.InReference.ReferenceShouldNotHaveIsbn.message}";
+
+ Class<? extends Payload>[] payload() default {};
+
+ Class<?>[] groups() default {}; //Level2.class
}
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.validation.constraint;\r
-\r
-import javax.validation.ConstraintValidator;\r
-import javax.validation.ConstraintValidatorContext;\r
-\r
-import eu.etaxonomy.cdm.validation.annotation.NullOrNotEmpty;\r
-\r
-public class NullOrNotEmptyValidator implements ConstraintValidator<NullOrNotEmpty, String> {\r
-\r
- @Override\r
- public void initialize(NullOrNotEmpty nullOrNotEmpty) { }\r
-\r
- @Override\r
- public boolean isValid(String string, ConstraintValidatorContext constraintContext) {\r
- boolean isValid = false;\r
- if(string == null) {\r
- isValid = true;\r
- } else if(string.trim().length() > 0) {\r
- isValid = true;\r
- }\r
-\r
- return isValid;\r
- }\r
-}\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.validation.constraint;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+import eu.etaxonomy.cdm.validation.annotation.NullOrNotEmpty;
+
+public class NullOrNotEmptyValidator implements ConstraintValidator<NullOrNotEmpty, String> {
+
+ @Override
+ public void initialize(NullOrNotEmpty nullOrNotEmpty) { }
+
+ @Override
+ public boolean isValid(String string, ConstraintValidatorContext constraintContext) {
+ boolean isValid = false;
+ if(string == null) {
+ isValid = true;
+ } else if(string.trim().length() > 0) {
+ isValid = true;
+ }
+
+ return isValid;
+ }
+}