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
ConversionCategory s. |
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
ConversionCategory
s. Otherwise an Error
is thrown.
TODO introduce more such functions, see RegexUtil for examples
IllegalFormatException
public static void tryFormatSatisfiability(String format) throws IllegalFormatException
IllegalFormatException
public 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