Class StringFormatValidator
java.lang.Object
org.jboss.logging.processor.validation.StringFormatValidator
- All Implemented Interfaces:
FormatValidator
A string format representation.
Date: 13.06.2011
- Author:
- James R. Perkins
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
The number of arguments needed for the format.asFormat()
Recreates the format using the internal formatting descriptors.final String
A detail message ifFormatValidator.isValid()
returnsfalse
, otherwise an empty string.format()
Returns the format string used for validation.boolean
isValid()
Returnstrue
of the format is valid, otherwisefalse
.static StringFormatValidator
Creates a string format.static StringFormatValidator
Creates a string format.final String
A summary message ifFormatValidator.isValid()
returnsfalse
, otherwise an empty string.toString()
static StringFormatValidator
withTranslation
(String format, String translationFormat) Creates a string format.
-
Field Details
-
PATTERN
The Regex pattern.
-
-
Method Details
-
of
Creates a string format.- Parameters:
format
- the format.- Returns:
- the string format.
-
withTranslation
Creates a string format. Note: The validator returned is the validator for the translation format.- Parameters:
format
- the format.translationFormat
- the format of the translation- Returns:
- the string format.
-
of
Creates a string format.- Parameters:
format
- the format.parameters
- the parameters to validate against.- Returns:
- the string format.
-
argumentCount
public int argumentCount()Description copied from interface:FormatValidator
The number of arguments needed for the format.- Returns:
- the number of arguments needed.
-
format
Description copied from interface:FormatValidator
Returns the format string used for validation.- Returns:
- the format string.
-
isValid
public boolean isValid()Description copied from interface:FormatValidator
Returnstrue
of the format is valid, otherwisefalse
.- Returns:
true
of the format is valid, otherwisefalse
.
-
asFormat
Recreates the format using the internal formatting descriptors.- Returns:
- the format.
-
toString
-
detailMessage
Description copied from interface:FormatValidator
A detail message ifFormatValidator.isValid()
returnsfalse
, otherwise an empty string.- Specified by:
detailMessage
in interfaceFormatValidator
- Returns:
- a detailed message.
-
summaryMessage
Description copied from interface:FormatValidator
A summary message ifFormatValidator.isValid()
returnsfalse
, otherwise an empty string.- Specified by:
summaryMessage
in interfaceFormatValidator
- Returns:
- a summary message.
-