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 210 f8aa3686d512
parent 209 8dfe037b3274
child 211 b5148f646278
InfoLister: private methods + formatter for formatter properties
java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Aug 15 10:47:56 2015 +0200
+++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Aug 15 10:53:35 2015 +0200
@@ -92,6 +92,7 @@
 				case JDBC_PROPERTIES:
 				case DATABASES:
 				case FORMATTERS:
+				case FORMATTER_PROPERTIES:
 				case TYPES:
 				case JAVA_PROPERTIES:
 				case ENVIRONMENT_VARIABLES:
@@ -182,7 +183,7 @@
 		}
 	}
 
-	public void listTypes() throws FormatterException, ConfigurationException {
+	private void listTypes() throws FormatterException, ConfigurationException {
 		ColumnsHeader header = constructHeader(new HeaderField("name", SQLType.VARCHAR), new HeaderField("code", SQLType.INTEGER));
 		List<Object[]> data = new ArrayList<>();
 		for (SQLType sqlType : SQLType.values()) {
@@ -192,7 +193,7 @@
 		log.log(Level.INFO, "Type names in --types option are case insensitive");
 	}
 
-	public void listDatabases() throws ConfigurationException, FormatterException {
+	private void listDatabases() throws ConfigurationException, FormatterException {
 		ColumnsHeader header = constructHeader(
 				new HeaderField("database_name", SQLType.VARCHAR),
 				new HeaderField("user_name", SQLType.VARCHAR),
@@ -220,7 +221,7 @@
 		printTable(formatter, header, "-- configured databases", null, data);
 	}
 
-	public void listJdbcDrivers() throws FormatterException, ConfigurationException {
+	private void listJdbcDrivers() throws FormatterException, ConfigurationException {
 		ColumnsHeader header = constructHeader(
 				new HeaderField("class", SQLType.VARCHAR),
 				new HeaderField("version", SQLType.VARCHAR),
@@ -243,7 +244,7 @@
 		printTable(formatter, header, "-- discovered JDBC drivers (available on the CLASSPATH)", null, data);
 	}
 
-	public void listJdbcProperties() throws FormatterException, ConfigurationException {
+	private void listJdbcProperties() throws FormatterException, ConfigurationException {
 		for (String dbName : options.getDatabaseNamesToListProperties()) {
 			ColumnsHeader header = constructHeader(
 					new HeaderField("property_name", SQLType.VARCHAR),
@@ -333,7 +334,7 @@
 	private static final long TESTING_AWAIT_LIMIT = 1;
 	private static final TimeUnit TESTING_AWAIT_UNIT = TimeUnit.DAYS;
 
-	public void testConnections() throws FormatterException, ConfigurationException {
+	private void testConnections() throws FormatterException, ConfigurationException {
 		ColumnsHeader header = constructHeader(
 				new HeaderField("database_name", SQLType.VARCHAR),
 				new HeaderField("configured", SQLType.BOOLEAN),
@@ -401,7 +402,7 @@
 		}
 	}
 
-	public Object[] testConnection(String dbName) {
+	private Object[] testConnection(String dbName) {
 		log.log(Level.FINE, "Testing connection to database: {0}", dbName);
 
 		boolean succesfullyConnected = false;
@@ -422,7 +423,7 @@
 		return new Object[]{dbName, succesfullyConfigured, succesfullyConnected};
 	}
 
-	public void printResource(String fileName) {
+	private void printResource(String fileName) {
 		try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) {
 			while (true) {
 				String line = reader.readLine();