void (PsiElement propValue, JsonSchemaObject schema, JsonValidationHost consumer) { String v = getValue(propValue, schema); if (v == null) return; final String value = StringUtil.unquoteString(v); if (schema.getMinLength() != null) { if (value.length() < schema.getMinLength()) { consumer.error(JsonBundle.message("schema.validation.string.shorter.than", schema.getMinLength()), propValue, JsonErrorPriority.LOW_PRIORITY); return; } } if (schema.getMaxLength() != null) { if (value.length() > schema.getMaxLength()) { consumer.error(JsonBundle.message("schema.validation.string.longer.than", schema.getMaxLength()), propValue, JsonErrorPriority.LOW_PRIORITY); return; } } if (schema.getPattern() != null) { if (schema.getPatternError() != null) { consumer.error(JsonBundle.message("schema.validation.invalid.string.pattern", StringUtil.convertLineSeparators(schema.getPatternError())), propValue, JsonErrorPriority.LOW_PRIORITY); } if (!schema.checkByPattern(value)) { consumer.error(JsonBundle.message("schema.validation.string.violates.pattern", StringUtil.convertLineSeparators(schema.getPattern())), propValue, JsonErrorPriority.LOW_PRIORITY); } } // I think we are not gonna to support format, there are a couple of RFCs there to check upon.. /* if (schema.getFormat() != null) { LOG.info("Unsupported property used: 'format'"); }*/ }