public class JSONValidation extends Object
| Constructor and Description |
|---|
JSONValidation() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isDate(String string)
Test for conformity to the
date format type. |
static boolean |
isDateTime(String string)
Test for conformity to the
date-time format type. |
static boolean |
isDuration(String string)
Test for conformity to the
duration format type. |
static boolean |
isEmail(String string)
Test for conformity to the
email format type. |
static boolean |
isHostname(String string)
Test for conformity to the
hostname format type. |
static boolean |
isIPV4(String string)
Test for conformity to the
ipv4 format type. |
static boolean |
isIPV6(String string)
Test for conformity to the
ipv6 format type. |
static boolean |
isTime(String string)
Test for conformity to the
time format type. |
static boolean |
isURI(String string)
Test for conformity to the
uri format type. |
static boolean |
isURIReference(String string)
Test for conformity to the
uri-reference format type. |
static boolean |
isUUID(String string)
Test for conformity to the
uuid format type. |
public static boolean isDateTime(String string)
date-time format type.string - the string to be testedtrue if the string is correctpublic static boolean isDate(String string)
date format type.string - the string to be testedtrue if the string is correctpublic static boolean isTime(String string)
time format type.string - the string to be testedtrue if the string is correctpublic static boolean isDuration(String string)
duration format type.string - the string to be testedtrue if the string is correctpublic static boolean isURI(String string)
uri format type.string - the string to be testedtrue if the string is correctpublic static boolean isURIReference(String string)
uri-reference format type.string - the string to be testedtrue if the string is correctpublic static boolean isUUID(String string)
uuid format type.string - the string to be testedtrue if the string is correctpublic static boolean isHostname(String string)
hostname format type.string - the string to be testedtrue if the string is correctpublic static boolean isEmail(String string)
email format type.string - the string to be testedtrue if the string is correctpublic static boolean isIPV4(String string)
ipv4 format type.string - the string to be testedtrue if the string is correctpublic static boolean isIPV6(String string)
ipv6 format type.
NOTE: The
JSON Schema Validation
specification says (§ 7.3.4) that a string conforming to the ipv6 format must be an "IPv6 address
as defined in RFC 4291, section 2.2". Subsequent to RFC 4291,
RFC 5952 recommended stricter restrictions on the
representation of IPV6 addresses, including mandating the use of lower case for all alpha characters, and
prohibiting the use of "::" to compress a single zero 16-bit field. Because the JSON Schema Validation
specification refers only to RFC 4291, not RFC 5952, this function does not implement the stricter restrictions
of the later document.
string - the string to be testedtrue if the string is correctCopyright © 2020. All rights reserved.