Class MessageFormatValidator
- java.lang.Object
-
- org.jboss.logging.processor.validation.AbstractFormatValidator
-
- org.jboss.logging.processor.validation.MessageFormatValidator
-
- All Implemented Interfaces:
FormatValidator
class MessageFormatValidator extends AbstractFormatValidator
Represents aMessageFormatstring. **Note: Currently the format type and format style are not validated Date: 14.06.2011
-
-
Field Summary
Fields Modifier and Type Field Description private intargumentCountprivate java.lang.Stringformatprivate java.util.Set<FormatPart>formatPartsprivate java.util.Set<MessageFormatPart>formatsstatic java.util.regex.PatternPATTERNprivate booleanvalid
-
Constructor Summary
Constructors Modifier Constructor Description privateMessageFormatValidator(java.lang.String format)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intargumentCount()The number of arguments needed for the format.java.lang.Stringformat()Returns the format string used for validation.private voidinit()booleanisValid()Returnstrueof the format is valid, otherwisefalse.static MessageFormatValidatorof(java.lang.String format)static MessageFormatValidatorof(java.lang.String format, int parameterCount)static MessageFormatValidatorof(java.lang.String format, java.lang.Object... parameters)private voidparameterCheck(int parameterCount)private voidparameterCheck(java.lang.Object... parameters)java.lang.StringtoString()private voidvalidate()-
Methods inherited from class org.jboss.logging.processor.validation.AbstractFormatValidator
detailMessage, setDetailMessage, setDetailMessage, setSummaryMessage, setSummaryMessage, summaryMessage
-
-
-
-
Field Detail
-
PATTERN
public static final java.util.regex.Pattern PATTERN
-
formatParts
private final java.util.Set<FormatPart> formatParts
-
formats
private final java.util.Set<MessageFormatPart> formats
-
argumentCount
private int argumentCount
-
valid
private boolean valid
-
format
private final java.lang.String format
-
-
Method Detail
-
of
public static MessageFormatValidator of(java.lang.String format)
-
of
public static MessageFormatValidator of(java.lang.String format, java.lang.Object... parameters)
-
of
public static MessageFormatValidator of(java.lang.String format, int parameterCount)
-
argumentCount
public int argumentCount()
Description copied from interface:FormatValidatorThe number of arguments needed for the format.- Returns:
- the number of arguments needed.
-
format
public java.lang.String format()
Description copied from interface:FormatValidatorReturns the format string used for validation.- Returns:
- the format string.
-
isValid
public boolean isValid()
Description copied from interface:FormatValidatorReturnstrueof the format is valid, otherwisefalse.- Returns:
trueof the format is valid, otherwisefalse.
-
validate
private void validate()
-
parameterCheck
private void parameterCheck(java.lang.Object... parameters)
-
parameterCheck
private void parameterCheck(int parameterCount)
-
init
private void init()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-