Package com.networknt.schema.format
Class PatternFormat
- java.lang.Object
-
- com.networknt.schema.format.PatternFormat
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessageKey()Gets the message key to use for the message.StringgetName()Gets the format name.booleanmatches(ExecutionContext executionContext, String value)Determines if the value matches the format.static PatternFormatof(String name, String regex, String messageKey)Creates a pattern format.
-
-
-
Method Detail
-
of
public static PatternFormat of(String name, String regex, String messageKey)
Creates a pattern format.- Parameters:
name- the nameregex- the regex patternmessageKey- the message key- Returns:
- the pattern format
-
matches
public boolean matches(ExecutionContext executionContext, String value)
Description copied from interface:FormatDetermines if the value matches the format.This should be implemented for string node types.
-
getMessageKey
public String 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 format name
{1} The input valueNote that the default localized messages do not use the input value.
- Specified by:
getMessageKeyin interfaceFormat- Returns:
- the message key
-
-