Merged in changes from cate-development branch and upgraded to spring 3.0.0.RC1
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / validation / constraint / StubValidator.java
1 package eu.etaxonomy.cdm.validation.constraint;
2
3 import java.lang.annotation.Annotation;
4
5 import javax.validation.ConstraintValidator;
6 import javax.validation.ConstraintValidatorContext;
7
8 /**
9 * Stub validatior for use when a constraint uses cdmlib-services component
10 * (and therfore the implementation requires components that are not visible
11 * in the cdmlib-model package)
12 *
13 * To resolve this circular dependency, use this stub as the validator in the
14 * annotation, then substitute an implementation using an XML config file.
15 *
16 * @author ben.clark
17 */
18 public class StubValidator implements
19 ConstraintValidator<Annotation,Object> {
20
21 public void initialize(Annotation annotation) { }
22
23 public boolean isValid(Object obj, ConstraintValidatorContext constraintContext) {
24 return true;
25 }
26 }