InfoLister (configuration listings) will use TabularPrefetchingFormatter as default
1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java Sat Dec 28 12:19:39 2013 +0100
1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java Sat Dec 28 16:45:04 2013 +0100
1.3 @@ -202,7 +202,9 @@
1.4 }
1.5
1.6 private Formatter getFormatter() throws ConfigurationException, FormatterException {
1.7 - FormatterDefinition fd = configurationProvider.getConfiguration().getFormatter(options.getFormatterName());
1.8 + String formatterName = options.getFormatterName();
1.9 + formatterName = formatterName == null ? Configuration.DEFAULT_FORMATTER_PREFETCHING : formatterName;
1.10 + FormatterDefinition fd = configurationProvider.getConfiguration().getFormatter(formatterName);
1.11 FormatterContext context = new FormatterContext(out);
1.12 return fd.getInstance(context);
1.13 }
2.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java Sat Dec 28 12:19:39 2013 +0100
2.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java Sat Dec 28 16:45:04 2013 +0100
2.3 @@ -45,6 +45,11 @@
2.4 * is used if no formatter is specified on CLI nor in user configuration
2.5 */
2.6 public static final String DEFAULT_FORMATTER = TabularFormatter.NAME;
2.7 + /**
2.8 + * Can be used as default if prefetching is ok – for configuration listings (config is alread in
2.9 + * memory, so this does not matter)
2.10 + */
2.11 + public static final String DEFAULT_FORMATTER_PREFETCHING = TabularPrefetchingFormatter.NAME;
2.12 private String defaultFormatter;
2.13 /**
2.14 * Default list of formatters. Is used if particular name is not found in user configuration.
3.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Sat Dec 28 12:19:39 2013 +0100
3.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Sat Dec 28 16:45:04 2013 +0100
3.3 @@ -22,7 +22,6 @@
3.4 import static info.globalcode.sql.dk.Functions.lpad;
3.5 import static info.globalcode.sql.dk.Functions.rpad;
3.6 import static info.globalcode.sql.dk.Functions.repeat;
3.7 -import java.util.Arrays;
3.8 import java.util.List;
3.9
3.10 /**