class ProjectJsonInputValidation {

	public void checkApiVersion(Errors errors, ProjectJsonInput input) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, ProjectJsonInput.PROPERTY_API_VERSION, "field.required");

		String apiVersion = input.getApiVersion();
		if (apiVersion == null) {
			return; /* handled before */
		}
		ValidationResult apiValidationResult = apiVersionValidation.validate(apiVersion);
		if (!apiValidationResult.isValid()) {
			errors.rejectValue(ProjectJsonInput.PROPERTY_API_VERSION, "api.error.unsupported.version",
					apiValidationResult.getErrorDescription());
		}
	}

}