private <T extends ConstraintValidator> T getConstraintValidator(
			Class<? extends T> constraintValidatorClass,
			Map<Class<? extends T>, T> cacheMap) {
		if (constraintValidatorClass == null) {
			return null;
		}

		// annotationMirror is an constraint annotation
		T validator = cacheMap.get(constraintValidatorClass);

		if (validator == null) {
			try {
				validator = constraintValidatorClass.newInstance();
				cacheMap.put(constraintValidatorClass, validator);
			} catch (Exception ex) {
				processingEnv.getMessager().printMessage(
						Diagnostic.Kind.ERROR,
						constraintValidatorClass
								+ " needs an empty constructor!");
			}
		}

		return validator;
	}