int realValue = getSizeValue(mainObject);
Range range = convertRange(spec.getRange(), pageValidation);
if (!range.holds(realValue)) {
throw new ValidationErrorException()
.withErrorArea(new ErrorArea(mainObject.getArea(), objectName))
.withMessage(format("\"%s\" %s is %dpx %s", objectName, getUnitName(), realValue, range.getErrorMessageSuffix()));
}
}