public class FormatUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FormatUtil.ExcessiveOrMissingFormatArgumentException |
static class |
FormatUtil.IllegalFormatConversionCategoryException |
| Constructor and Description |
|---|
FormatUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asFormat(String format,
ConversionCategory... cc)
Returns if the format string is satisfiable, and if the format's parameters match the passed
ConversionCategorys. |
static ConversionCategory[] |
formatParameterCategories(String format)
Returns a
ConversionCategory for every conversion found in the format string. |
static void |
tryFormatSatisfiability(String format)
Throws an exception if the format is not syntactically valid.
|
@ReturnsFormat public static String asFormat(String format, ConversionCategory... cc) throws IllegalFormatException
ConversionCategorys. Otherwise an Error is thrown.
TODO introduce more such functions, see RegexUtil for examples
IllegalFormatExceptionpublic static void tryFormatSatisfiability(String format) throws IllegalFormatException
IllegalFormatExceptionpublic static ConversionCategory[] formatParameterCategories(String format) throws IllegalFormatException
ConversionCategory for every conversion found in the format string.
Throws an exception if the format is not syntactically valid.
IllegalFormatException