property annotations: dummy InfoLister table v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 15 Aug 2015 11:07:50 +0200
branchv_0
changeset 211 b5148f646278
parent 210 f8aa3686d512
child 212 d154d6012cbe
property annotations: dummy InfoLister table
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:53:35 2015 +0200
+++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Sat Aug 15 11:07:50 2015 +0200
@@ -177,12 +177,32 @@
 		}
 	}
 
-	private void listFormatterProperties() {
-		for (String name : options.getFormatterNamesToListProperties()) {
-			log.log(Level.SEVERE, "TODO: list formatter properties for {0}", name);
+	private void listFormatterProperties() throws FormatterException, ConfigurationException {
+		for (String formatterName : options.getFormatterNamesToListProperties()) {
+			listFormatterProperties(formatterName);
 		}
 	}
 
+	private void listFormatterProperties(String formatterName) throws FormatterException, ConfigurationException {
+		ColumnsHeader header = constructHeader(
+				new HeaderField("name", SQLType.VARCHAR),
+				new HeaderField("type", SQLType.VARCHAR),
+				new HeaderField("default", SQLType.VARCHAR),
+				new HeaderField("description", SQLType.VARCHAR)
+		);
+		List<Object[]> data = new ArrayList<>();
+
+		data.add(new Object[]{"TODO", "a", "b", "c"});
+		data.add(new Object[]{"TODO", "a", "b", "c"});
+		data.add(new Object[]{"TODO", "a", "b", "c"});
+		data.add(new Object[]{"TODO", "a", "b", "c"});
+
+		List<Parameter> parameters = new ArrayList<>();
+		parameters.add(new NamedParameter("formatter", formatterName, SQLType.VARCHAR));
+
+		printTable(formatter, header, "-- formatter properties", parameters, data);
+	}
+
 	private void listTypes() throws FormatterException, ConfigurationException {
 		ColumnsHeader header = constructHeader(new HeaderField("name", SQLType.VARCHAR), new HeaderField("code", SQLType.INTEGER));
 		List<Object[]> data = new ArrayList<>();