XML formatter: rows, columns, updates results v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 04 Jan 2014 19:54:11 +0100
branchv_0
changeset 129331634456bf8
parent 128 67f5ff139da0
child 130 8548e21177f9
XML formatter: rows, columns, updates results
java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java	Sat Jan 04 19:39:35 2014 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/XmlFormatter.java	Sat Jan 04 19:54:11 2014 +0100
     1.3 @@ -116,4 +116,44 @@
     1.4  			printEmptyElement(qname("columnHeader"), attributes);
     1.5  		}
     1.6  	}
     1.7 +
     1.8 +	@Override
     1.9 +	public void writeStartRow() {
    1.10 +		super.writeStartRow();
    1.11 +		printStartElement(qname("row"));
    1.12 +	}
    1.13 +
    1.14 +	@Override
    1.15 +	public void writeColumnValue(Object value) {
    1.16 +		super.writeColumnValue(value);
    1.17 +		printTextElement(qname("column"), null, toString(value));
    1.18 +	}
    1.19 +
    1.20 +	@Override
    1.21 +	public void writeEndRow() {
    1.22 +		super.writeEndRow();
    1.23 +		printEndElement();
    1.24 +	}
    1.25 +
    1.26 +	@Override
    1.27 +	public void writeStartUpdatesResult() {
    1.28 +		super.writeStartUpdatesResult();
    1.29 +		printStartElement(qname("updatesResult"));
    1.30 +	}
    1.31 +
    1.32 +	@Override
    1.33 +	public void writeUpdatedRowsCount(int updatedRowsCount) {
    1.34 +		super.writeUpdatedRowsCount(updatedRowsCount);
    1.35 +		printTextElement(qname("updatedRows"), null, String.valueOf(updatedRowsCount));
    1.36 +	}
    1.37 +
    1.38 +	@Override
    1.39 +	public void writeEndUpdatesResult() {
    1.40 +		super.writeEndUpdatesResult();
    1.41 +		printEndElement();
    1.42 +	}
    1.43 +
    1.44 +	protected String toString(Object value) {
    1.45 +		return String.valueOf(value);
    1.46 +	}
    1.47  }