Package org.jboss.logging.processor.validation

# Class StringFormatValidator

java.lang.Object
org.jboss.logging.processor.validation.StringFormatValidator

All Implemented Interfaces:
  `FormatValidator`

public final class StringFormatValidator extends Object
A string format representation.

Date: 13.06.2011

Author:
  James R. Perkins

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Pattern`
`PATTERN`
The Regex pattern.

## Method Summary

Modifier and Type
Method
Description
`int`
`argumentCount()`
The number of arguments needed for the format.
`String`
`asFormat()`
Recreates the format using the internal formatting descriptors.
`final String`
`detailMessage()`
A detail message if `FormatValidator.isValid()` returns `false`, otherwise an empty string.
`String`
`format()`
Returns the format string used for validation.
`boolean`
`isValid()`
Returns `true` of the format is valid, otherwise `false`.
`static StringFormatValidator`
`of(String format)`
Creates a string format.
`static StringFormatValidator`
`of(String format, Object... parameters)`
Creates a string format.
`final String`
`summaryMessage()`
A summary message if `FormatValidator.isValid()` returns `false`, otherwise an empty string.
`String`
`toString()`
`static StringFormatValidator`
`withTranslation(String format, String translationFormat)`
Creates a string format.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### PATTERN

public static final Pattern PATTERN
The Regex pattern.

## Method Details

### of

public static StringFormatValidator of(String format)
Creates a string format.

Parameters:
  `format` - the format.
Returns:
  the string format.

### withTranslation

public static StringFormatValidator withTranslation(String format, String translationFormat)
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

public static StringFormatValidator of(String format, Object... parameters)
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

public String 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`
Returns `true` of the format is valid, otherwise `false`.

Returns:
  `true` of the format is valid, otherwise `false`.

### asFormat

public String asFormat()
Recreates the format using the internal formatting descriptors.

Returns:
  the format.

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### detailMessage

public final String detailMessage()
Description copied from interface: `FormatValidator`
A detail message if `FormatValidator.isValid()` returns `false`, otherwise an empty string.

Specified by:
  `detailMessage` in interface `FormatValidator`
Returns:
  a detailed message.

### summaryMessage

public final String summaryMessage()
Description copied from interface: `FormatValidator`
A summary message if `FormatValidator.isValid()` returns `false`, otherwise an empty string.

Specified by:
  `summaryMessage` in interface `FormatValidator`
Returns:
  a summary message.