package com.ejie.y42b.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class Y42bNifCifValidator implements
		ConstraintValidator<Y42bNifCif, String> {

	@Override
	public void initialize(Y42bNifCif constraintAnnotation) {
	}

	@Override
	public boolean isValid(String value, ConstraintValidatorContext context) {

		Y42bNifValidator y41aNifValidator = new Y42bNifValidator();
		Y42bCifValidator y41aCifValidator = new Y42bCifValidator();

		if (y41aNifValidator.isValid(value, context)) {
			return true;
		} else {
			return y41aCifValidator.isValid(value, context);
		}
	}
}