public final class FormatKeywordValidator extends KeywordValidator
format keyword
This keyword is scheduled for disappearance in draft v4. However, some people have raised concerns about this.
All format specifiers from draft v3 are supported except style
and color (which validate an entire CSS 2.1 style and color
respectively!).
There is support here for one custom specifier: date-time-ms. The
v3 draft specifies that date-time should match the pattern
YYYY-MM-DDThh:mm:ssZ. date-time-ms extends that to a format
supporting milliseconds: YYYY-MM-DDThh:mm:ss.SSSZ.
org.eel.kitchen.jsonschema.format| Modifier and Type | Field and Description |
|---|---|
private String |
fmtattr |
private FormatSpecifier |
specifier |
private static Map<String,FormatSpecifier> |
specifiers
Static final map of all format specifiers.
|
keyword| Constructor and Description |
|---|
FormatKeywordValidator(JsonNode schema) |
| Modifier and Type | Method and Description |
|---|---|
String |
toString() |
protected void |
validate(ValidationContext context,
ValidationReport report,
JsonNode instance)
Method which all keyword validators must implement
|
validateInstanceprivate static final Map<String,FormatSpecifier> specifiers
private final String fmtattr
private final FormatSpecifier specifier
public FormatKeywordValidator(JsonNode schema)
protected void validate(ValidationContext context, ValidationReport report, JsonNode instance)
KeywordValidatorvalidate in class KeywordValidatorcontext - the contextreport - the validation reportinstance - the instance to validatepublic String toString()
toString in class KeywordValidatorCopyright © 2012. All Rights Reserved.