InfoLister (configuration listings) will use TabularPrefetchingFormatter as default v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 28 Dec 2013 16:45:04 +0100
branchv_0
changeset 8998d18e9a357b
parent 88 102ba0fcb07f
child 90 ce2b7576ab67
InfoLister (configuration listings) will use TabularPrefetchingFormatter as default
java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java
java/sql-dk/src/info/globalcode/sql/dk/configuration/Configuration.java
java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java
     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  /**