java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractXmlFormatter.java
branchv_0
changeset 206 e2f24eea8543
parent 155 eb3676c6929b
child 207 2bba68ef47c1
--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractXmlFormatter.java	Sat Aug 15 10:04:28 2015 +0200
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractXmlFormatter.java	Sat Aug 15 10:20:39 2015 +0200
@@ -23,6 +23,9 @@
 import javax.xml.namespace.QName;
 import static info.globalcode.sql.dk.Functions.isEmpty;
 import static info.globalcode.sql.dk.Functions.toHex;
+import info.globalcode.sql.dk.configuration.PropertyDeclaration;
+import static info.globalcode.sql.dk.formatting.CommonProperties.COLORFUL;
+import static info.globalcode.sql.dk.formatting.CommonProperties.COLORFUL_DESCRIPTION;
 import java.nio.charset.Charset;
 import java.util.EmptyStackException;
 import java.util.HashMap;
@@ -44,10 +47,12 @@
  *
  * @author Ing. František Kučera (frantovo.cz)
  */
+@PropertyDeclaration(name = COLORFUL, type = Boolean.class, description = COLORFUL_DESCRIPTION)
+@PropertyDeclaration(name = AbstractXmlFormatter.PROPERTY_INDENT, type = String.class, description = "tab or sequence of spaces used for indentation of nested elements")
+@PropertyDeclaration(name = AbstractXmlFormatter.PROPERTY_INDENT_TEXT, type = Boolean.class, description = "whether to indent text nodes")
 public abstract class AbstractXmlFormatter extends AbstractFormatter {
 
 	private static final Logger log = Logger.getLogger(AbstractXmlFormatter.class.getName());
-	public static final String PROPERTY_COLORFUL = "color";
 	public static final String PROPERTY_INDENT = "indent";
 	/**
 	 * Whether text with line breaks should be indented (default). Otherwise original whitespace
@@ -66,7 +71,7 @@
 
 	public AbstractXmlFormatter(FormatterContext formatterContext) {
 		super(formatterContext);
-		boolean colorful = formatterContext.getProperties().getBoolean(PROPERTY_COLORFUL, false);
+		boolean colorful = formatterContext.getProperties().getBoolean(COLORFUL, false);
 		out = new ColorfulPrintWriter(formatterContext.getOutputStream(), false, colorful);
 		indent = formatterContext.getProperties().getString(PROPERTY_INDENT, "\t");
 		indentText = formatterContext.getProperties().getBoolean(PROPERTY_INDENT_TEXT, true);