+ * Provides helper methods for printing pretty intended and optionally colorful (syntax highlighted)
+ * XML output.
+ *
+ *
+ *
+ * Must be used with care – bad usage can lead to invalid XML (e.g. using undeclared namespaces).
+ *
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -22,6 +22,9 @@
import java.util.List;
/**
+ * The formatter is responsible for printing the result sets and/or updates result (count of
+ * inserted/updated rows). The formatter can produce output in arbitrary format – text, some markup
+ * or even binary data.
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/FormatterContext.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/FormatterContext.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/FormatterContext.java Fri Jan 10 23:21:28 2014 +0100
@@ -21,6 +21,7 @@
import java.io.OutputStream;
/**
+ * To be passed from the SQL-DK core to the formatter.
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -25,8 +25,14 @@
import java.util.List;
/**
+ *
Prints human-readable output – tables of result sets and text messages with update counts.
+ *
+ *
Longer values might break the table – overflow the cells – see alternative tabular formatters
+ * and the {@linkplain #PROPERTY_TRIM} property.
*
* @author Ing. František Kučera (frantovo.cz)
+ * @see TabularPrefetchingFormatter
+ * @see TabularWrappingFormatter
*/
public class TabularFormatter extends AbstractFormatter {
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularPrefetchingFormatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularPrefetchingFormatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularPrefetchingFormatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -21,10 +21,14 @@
import java.util.List;
/**
+ *
* Prefetches whole result set and computes column widths. Whole table is flushed at once in
* {@linkplain #writeEndResultSet()}.
+ *
*
- * Long values will not overflow the cells, but whole result set must be loaded into memory.
+ *
+ * Long values will not overflow the cells, but whole result set must be loaded into the memory.
+ *
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularWrappingFormatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularWrappingFormatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularWrappingFormatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -25,6 +25,8 @@
import static info.globalcode.sql.dk.Functions.repeat;
/**
+ * Longer values are line-wrapped – the cell then contains multiple lines. Marks are added to
+ * signalize forced line ends (not present in original data).
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/XhtmlFormatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/XhtmlFormatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/XhtmlFormatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -36,6 +36,9 @@
import javax.xml.namespace.QName;
/**
+ * Prints result sets and parameters as tables, SQL as preformatted and updates counts as
+ * paragraphs. You can pick XHTML fragments (usually tabular data) and use it on your website or use
+ * whole output as preview or report.
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -29,6 +29,10 @@
import javax.xml.namespace.QName;
/**
+ *
Prints machine-readable output – XML document containing resultsets and updates count. Good
+ * choice for further processing – e.g. XSL transformation.
+ *
+ *
TODO: XSD
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/logging/ColorfulConsoleFormatter.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/logging/ColorfulConsoleFormatter.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/logging/ColorfulConsoleFormatter.java Fri Jan 10 23:21:28 2014 +0100
@@ -27,6 +27,7 @@
import java.util.logging.LogRecord;
/**
+ * For console/terminal log output. Log messages are printed in brief and colorful form.
*
* @author Ing. František Kučera (frantovo.cz)
*/
diff -r 016836529e6c -r eb3676c6929b java/sql-dk/src/info/globalcode/sql/dk/logging/LoggerInitializer.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/logging/LoggerInitializer.java Fri Jan 10 20:13:16 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/logging/LoggerInitializer.java Fri Jan 10 23:21:28 2014 +0100
@@ -47,7 +47,7 @@
/**
- * TODO: FileHandler – detailed logs in file in ~/sql-dk/log/…
+ * TODO: optional FileHandler – detailed logs in file in ~/sql-dk/log/…
*/
}