Class PatternFormat
java.lang.Object
com.networknt.schema.format.PatternFormat
- All Implemented Interfaces:
Format
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionPatternFormat(String name, String regex, String errorMessageDescription) Deprecated.privatePatternFormat(String name, String regex, String errorMessageDescription, String messageKey) -
Method Summary
Modifier and TypeMethodDescriptionGets the error message description.Gets the message key to use for the message.getName()Gets the format name.booleanmatches(ExecutionContext executionContext, String value) Determines if the value matches the format.static PatternFormatCreates a pattern format.
-
Field Details
-
name
-
pattern
-
messageKey
-
errorMessageDescription
-
-
Constructor Details
-
PatternFormat
Deprecated.Constructor.Use
of(String, String, String)instead.- Parameters:
name- the nameregex- the regexerrorMessageDescription- the error message description
-
PatternFormat
-
-
Method Details
-
of
Creates a pattern format.- Parameters:
name- the nameregex- the regex patternmessageKey- the message key- Returns:
- the pattern format
-
matches
Description copied from interface:FormatDetermines if the value matches the format.This should be implemented for string node types.
-
getName
-
getMessageKey
Description copied from interface:FormatGets the message key to use for the message.See jsv-messages.properties.
The following are the arguments.
{0} The instance location
{1} The format name
{2} The error message description
{3} The input value- Specified by:
getMessageKeyin interfaceFormat- Returns:
- the message key
-
getErrorMessageDescription
Description copied from interface:FormatGets the error message description.Deprecated. Override getMessageKey() and set the localized message in the resource bundle or message source.
- Specified by:
getErrorMessageDescriptionin interfaceFormat- Returns:
- the error message description.
-