com.networknt.schema.regex.RegularExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-schema-validator Show documentation
Show all versions of json-schema-validator Show documentation
A json schema validator that supports draft v4, v6, v7, v2019-09 and v2020-12
package com.networknt.schema.regex;
import com.networknt.schema.ValidationContext;
@FunctionalInterface
public interface RegularExpression {
boolean matches(String value);
static RegularExpression compile(String regex, ValidationContext validationContext) {
if (null == regex) return s -> true;
return validationContext.getConfig().isEcma262Validator()
? new JoniRegularExpression(regex)
: new JDKRegularExpression(regex);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy