Class FormatUtil
java.lang.Object
org.checkerframework.checker.formatter.util.FormatUtil
This class provides a collection of utilities to ease working with format strings.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic class
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringasFormat(String format, ConversionCategory... cc) Returns the first argument if the format string is satisfiable, and if the format's parameters match the passedConversionCategorys.static charconversionCharFromFormat(String formatSpecifier) Deprecated.This method is public only for testing.static ConversionCategory[]formatParameterCategories(String format) Returns aConversionCategoryfor every conversion found in the format string.static voidtryFormatSatisfiability(String format) Throws an exception if the format is not syntactically valid.
- 
Constructor Details- 
FormatUtilpublic FormatUtil()
 
- 
- 
Method Details- 
asFormat@ReturnsFormat public static String asFormat(String format, ConversionCategory... cc) throws IllegalFormatException Returns the first argument if the format string is satisfiable, and if the format's parameters match the passedConversionCategorys. Otherwise throws an exception.- Parameters:
- format- a format string
- cc- an array of conversion categories
- Returns:
- the formatargument
- Throws:
- IllegalFormatException- if the format string is incompatible with the conversion categories
 
- 
tryFormatSatisfiabilityThrows an exception if the format is not syntactically valid.- Parameters:
- format- a format string
- Throws:
- IllegalFormatException- if the format string is invalid
 
- 
formatParameterCategoriespublic static ConversionCategory[] formatParameterCategories(String format) throws IllegalFormatException Returns aConversionCategoryfor every conversion found in the format string.Throws an exception if the format is not syntactically valid. - Throws:
- IllegalFormatException
 
- 
conversionCharFromFormatDeprecated.This method is public only for testing. Use private method#conversionCharFromFormat(Matcher).Return the conversion character that is in the given format specifier.- Parameters:
- formatSpecifier- a format specifier
- Returns:
- the conversion character that is in the given format specifier
 
 
-