class MessageFormatValidator extends AbstractFormatValidator
MessageFormat
string.
**Note: Currently the format type and format style are not validated
Date: 14.06.2011Modifier and Type | Field and Description |
---|---|
private int |
argumentCount |
private java.lang.String |
format |
private java.util.Set<FormatPart> |
formatParts |
private java.util.Set<MessageFormatPart> |
formats |
static java.util.regex.Pattern |
PATTERN |
private boolean |
valid |
Modifier | Constructor and Description |
---|---|
private |
MessageFormatValidator(java.lang.String format) |
Modifier and Type | Method and Description |
---|---|
int |
argumentCount()
The number of arguments needed for the format.
|
java.lang.String |
format()
Returns the format string used for validation.
|
private void |
init() |
boolean |
isValid()
Returns
true of the format is valid, otherwise false . |
static MessageFormatValidator |
of(java.lang.String format) |
static MessageFormatValidator |
of(java.lang.String format,
int parameterCount) |
static MessageFormatValidator |
of(java.lang.String format,
java.lang.Object... parameters) |
private void |
parameterCheck(int parameterCount) |
private void |
parameterCheck(java.lang.Object... parameters) |
java.lang.String |
toString() |
private void |
validate() |
detailMessage, setDetailMessage, setDetailMessage, setSummaryMessage, setSummaryMessage, summaryMessage
public static final java.util.regex.Pattern PATTERN
private final java.util.Set<FormatPart> formatParts
private final java.util.Set<MessageFormatPart> formats
private int argumentCount
private boolean valid
private final java.lang.String format
public static MessageFormatValidator of(java.lang.String format)
public static MessageFormatValidator of(java.lang.String format, java.lang.Object... parameters)
public static MessageFormatValidator of(java.lang.String format, int parameterCount)
public int argumentCount()
FormatValidator
public java.lang.String format()
FormatValidator
public boolean isValid()
FormatValidator
true
of the format is valid, otherwise false
.true
of the format is valid, otherwise false
.private void validate()
private void parameterCheck(java.lang.Object... parameters)
private void parameterCheck(int parameterCount)
private void init()
public java.lang.String toString()
toString
in class java.lang.Object