InfoLister: private methods + formatter for formatter properties v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 15 Aug 2015 10:53:35 +0200
branchv_0
changeset 210f8aa3686d512
parent 209 8dfe037b3274
child 211 b5148f646278
InfoLister: private methods + formatter for formatter properties
java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Aug 15 10:47:56 2015 +0200
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Aug 15 10:53:35 2015 +0200
     1.3 @@ -92,6 +92,7 @@
     1.4  				case JDBC_PROPERTIES:
     1.5  				case DATABASES:
     1.6  				case FORMATTERS:
     1.7 +				case FORMATTER_PROPERTIES:
     1.8  				case TYPES:
     1.9  				case JAVA_PROPERTIES:
    1.10  				case ENVIRONMENT_VARIABLES:
    1.11 @@ -182,7 +183,7 @@
    1.12  		}
    1.13  	}
    1.14  
    1.15 -	public void listTypes() throws FormatterException, ConfigurationException {
    1.16 +	private void listTypes() throws FormatterException, ConfigurationException {
    1.17  		ColumnsHeader header = constructHeader(new HeaderField("name", SQLType.VARCHAR), new HeaderField("code", SQLType.INTEGER));
    1.18  		List<Object[]> data = new ArrayList<>();
    1.19  		for (SQLType sqlType : SQLType.values()) {
    1.20 @@ -192,7 +193,7 @@
    1.21  		log.log(Level.INFO, "Type names in --types option are case insensitive");
    1.22  	}
    1.23  
    1.24 -	public void listDatabases() throws ConfigurationException, FormatterException {
    1.25 +	private void listDatabases() throws ConfigurationException, FormatterException {
    1.26  		ColumnsHeader header = constructHeader(
    1.27  				new HeaderField("database_name", SQLType.VARCHAR),
    1.28  				new HeaderField("user_name", SQLType.VARCHAR),
    1.29 @@ -220,7 +221,7 @@
    1.30  		printTable(formatter, header, "-- configured databases", null, data);
    1.31  	}
    1.32  
    1.33 -	public void listJdbcDrivers() throws FormatterException, ConfigurationException {
    1.34 +	private void listJdbcDrivers() throws FormatterException, ConfigurationException {
    1.35  		ColumnsHeader header = constructHeader(
    1.36  				new HeaderField("class", SQLType.VARCHAR),
    1.37  				new HeaderField("version", SQLType.VARCHAR),
    1.38 @@ -243,7 +244,7 @@
    1.39  		printTable(formatter, header, "-- discovered JDBC drivers (available on the CLASSPATH)", null, data);
    1.40  	}
    1.41  
    1.42 -	public void listJdbcProperties() throws FormatterException, ConfigurationException {
    1.43 +	private void listJdbcProperties() throws FormatterException, ConfigurationException {
    1.44  		for (String dbName : options.getDatabaseNamesToListProperties()) {
    1.45  			ColumnsHeader header = constructHeader(
    1.46  					new HeaderField("property_name", SQLType.VARCHAR),
    1.47 @@ -333,7 +334,7 @@
    1.48  	private static final long TESTING_AWAIT_LIMIT = 1;
    1.49  	private static final TimeUnit TESTING_AWAIT_UNIT = TimeUnit.DAYS;
    1.50  
    1.51 -	public void testConnections() throws FormatterException, ConfigurationException {
    1.52 +	private void testConnections() throws FormatterException, ConfigurationException {
    1.53  		ColumnsHeader header = constructHeader(
    1.54  				new HeaderField("database_name", SQLType.VARCHAR),
    1.55  				new HeaderField("configured", SQLType.BOOLEAN),
    1.56 @@ -401,7 +402,7 @@
    1.57  		}
    1.58  	}
    1.59  
    1.60 -	public Object[] testConnection(String dbName) {
    1.61 +	private Object[] testConnection(String dbName) {
    1.62  		log.log(Level.FINE, "Testing connection to database: {0}", dbName);
    1.63  
    1.64  		boolean succesfullyConnected = false;
    1.65 @@ -422,7 +423,7 @@
    1.66  		return new Object[]{dbName, succesfullyConfigured, succesfullyConnected};
    1.67  	}
    1.68  
    1.69 -	public void printResource(String fileName) {
    1.70 +	private void printResource(String fileName) {
    1.71  		try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) {
    1.72  			while (true) {
    1.73  				String line = reader.readLine();