/** * Format the given {@link String} as a Java source type, using the given code format {@link Properties} */ public static String format(Properties properties, String source) { String result = source; for (FormatterProvider formatter : getFormatters()) { result = formatter.format(properties, result); } return result; }
/** * Format the given {@link String} as a Java source file, using the built in code format style. * * @param source a java source code * @return the formatted source code * @throws IllegalStateException if no formatter is available in the classPath */ public static String format(String source) { String result = source; for (FormatterProvider formatter : getFormatters()) { result = formatter.format(result); } return result; }
/** * Format the given {@link String} as a Java source file, using the built in code format style. * * @param source a java source code * @return the formatted source code */ public static String format(String source) { String result = source; for (FormatterProvider formatter : getFormatters()) { result = formatter.format(result); } return result; }
/** * Format the given {@link String} as a Java source type, using the given code format {@link Properties} * * @param properties the properties to use to format * @param source a java source code * @return the formatted source code * @throws IllegalStateException if no formatter is available in the classPath */ public static String format(Properties properties, String source) { String result = source; for (FormatterProvider formatter : getFormatters()) { result = formatter.format(properties, result); } return result; } }