Package com.networknt.schema.format
Class DurationFormat
- java.lang.Object
-
- com.networknt.schema.format.DurationFormat
-
-
Constructor Summary
Constructors Constructor Description DurationFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetMessageKey()Gets the message key to use for the message.java.lang.StringgetName()Gets the format name.protected booleanisStrictValidation(ValidationContext validationContext)booleanmatches(ExecutionContext executionContext, ValidationContext validationContext, java.lang.String duration)Determines if the value matches the format.
-
-
-
Field Detail
-
DURATION
private static final java.lang.String DURATION
- See Also:
- Constant Field Values
-
STRICT
private static final java.util.regex.Pattern STRICT
-
LAX
private static final java.util.regex.Pattern LAX
-
-
Method Detail
-
matches
public boolean matches(ExecutionContext executionContext, ValidationContext validationContext, java.lang.String duration)
Description copied from interface:FormatDetermines if the value matches the format.
-
isStrictValidation
protected boolean isStrictValidation(ValidationContext validationContext)
-
getName
public java.lang.String getName()
Description copied from interface:FormatGets the format name.
-
getMessageKey
public java.lang.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 instance location
{1} The format name
{2} The error message description
{3} The input value- Specified by:
getMessageKeyin interfaceFormat- Returns:
- the message key
-
-