| Class | Description |
|---|---|
| AbstractDateFormatAttribute |
Specialized format validator for date/time checking
|
| DateTimeFormatAttribute |
Validator for the
date-time format specification |
| EmailFormatAttribute |
Validator for the
email format specification. |
| FormatAttribute |
Base class for a format attribute
|
| FormatBundle |
A bundle of format attributes
|
| HostnameFormatAttribute |
Validator for the
host-name format specification |
| IPV4FormatAttribute |
Validator for the
ip-address format specification, ie an IPv4 address |
| IPV6FormatAttribute |
Validator for the
ipv6 format specification |
| RegexFormatAttribute |
Validator for the
regex format specification |
| URIFormatAttribute |
Validator for the
uri format specification |
The format keyword is defined by section 5.23 of the current
draft. This particular package supports the following format attributes:
date-time;email;host-name;ip-address;ipv6;regex;uri.All other format attributes defined by the draft (except color and
style, for which support is deliberately omitted) are now in a
separate package: json-schema-formats
.
In addition to using the package above, you can also implement your own
format attributes by creating a FormatBundle and setting/merging your
bundle into your schema factory. See also FormatAttribute.
Note: by default, the host-name and email format
attributes require that both validated values have a domain part. This
contradicts what the respective RFCs say, but it is more in line with user
expectations. You can tell these formats to strictly comply to the RFC by
setting ValidationFeature.STRICT_RFC_CONFORMANCE
when building your schema factory (see JsonSchemaFactory.Builder.enableFeature(org.eel.kitchen.jsonschema.main.ValidationFeature)).
Copyright © 2012. All Rights Reserved.