Package de.businesscode.bcdui.wrs.load
Class WrsDataWriter
- java.lang.Object
-
- de.businesscode.bcdui.wrs.load.AbstractDataWriter
-
- de.businesscode.bcdui.wrs.load.WrsDataWriter
-
- All Implemented Interfaces:
IDataWriter
public class WrsDataWriter extends AbstractDataWriter implements IDataWriter
The default implementation of the IDataWriter - write wrs-xml-format using xml-stream
Write an empty document if the resultSet is null.
Supports also the short refDataFormat.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
WRS_XML_NAMESPACE
-
Fields inherited from class de.businesscode.bcdui.wrs.load.AbstractDataWriter
rowCounter
-
-
Constructor Summary
Constructors Constructor Description WrsDataWriter()
WrsDataWriter.WrsDataWriter(javax.xml.stream.XMLStreamWriter writer)
WrsDataWriter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
close the destination resourceprotected java.io.Writer
getLazyStream()
protected javax.xml.stream.XMLStreamWriter
getWriter()
protected void
write()
replace the write method from interfaceprotected void
writeEmptyDocument()
Write empty document if no data was requestedprotected void
writeWrs()
writeWrsprotected void
writeWrsData()
writeWrsDataprotected void
writeWrsDataRow(int rowNum)
writeWrsDataRowprotected void
writeWrsDataRowAttributes(int rowNum)
writeWrsDataRowAttributesprotected void
writeWrsDataRowColumn(WrsBindingItem item)
writeWrsDataRowColumnprotected void
writeWrsDataRowColumnAttributes(WrsBindingItem item)
Writes the attributes corresponding to wrs:A sub-nodes of a wrs:C Attributes are not written if their value was nullprotected void
writeWrsDataRowColumnValue(int jdbcColumnType, int colNum)
writeWrsDataRowColumnValueprotected void
writeWrsErrorDuringQuery()
protected void
writeWrsHeaderColumns()
writeWrsHeaderColumnsprotected void
writeWrsHeaderDebug()
writeWrsHeaderDebugprotected void
writeWrsMaxRowsExceeded(int maxRows)
writeWrsMaxRowsExceededprotected void
writeWrsRequest()
-
Methods inherited from class de.businesscode.bcdui.wrs.load.AbstractDataWriter
getColumnsCount, getDuration, getGenerator, getOptions, getRequestDocRoot, getResultSet, getResultSetMetaData, getRowCount, isEscapeXMLType, setEscapeXMLType, write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.businesscode.bcdui.wrs.load.IDataWriter
getColumnsCount, getRowCount, write
-
-
-
-
Field Detail
-
WRS_XML_NAMESPACE
public static final java.lang.String WRS_XML_NAMESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getWriter
protected final javax.xml.stream.XMLStreamWriter getWriter()
- Returns:
- the writer
-
getLazyStream
protected java.io.Writer getLazyStream() throws java.lang.Exception
- Returns:
- the output writer.
The clients can overwrite this method like: return response.getWriter().
This method called only once by lazy creation of the xml-writer (if it was not sets from constructor parameters. - Throws:
java.lang.Exception
-
close
public void close() throws java.lang.Exception
Description copied from interface:IDataWriter
close the destination resource- Specified by:
close
in interfaceIDataWriter
- Throws:
java.lang.Exception
- See Also:
IDataWriter.close()
-
write
protected void write() throws java.lang.Exception
Description copied from class:AbstractDataWriter
replace the write method from interface- Specified by:
write
in classAbstractDataWriter
- Throws:
java.lang.Exception
- See Also:
AbstractDataWriter.write()
-
writeEmptyDocument
protected void writeEmptyDocument() throws java.lang.Exception
Write empty document if no data was requested- Throws:
javax.xml.stream.XMLStreamException
java.lang.Exception
-
writeWrs
protected void writeWrs() throws java.lang.Exception
writeWrs- Throws:
java.lang.Exception
-
writeWrsRequest
protected void writeWrsRequest() throws java.lang.Exception
- Throws:
java.lang.Exception
-
writeWrsHeaderColumns
protected void writeWrsHeaderColumns() throws java.lang.Exception
writeWrsHeaderColumns- Throws:
java.lang.Exception
-
writeWrsHeaderDebug
protected void writeWrsHeaderDebug() throws java.lang.Exception
writeWrsHeaderDebug- Throws:
java.lang.Exception
-
writeWrsData
protected void writeWrsData() throws java.lang.Exception
writeWrsData- Throws:
java.lang.Exception
-
writeWrsDataRow
protected void writeWrsDataRow(int rowNum) throws java.lang.Exception
writeWrsDataRow- Parameters:
rowNum
-- Throws:
java.lang.Exception
-
writeWrsDataRowAttributes
protected void writeWrsDataRowAttributes(int rowNum) throws java.lang.Exception
writeWrsDataRowAttributes- Parameters:
rowNum
-- Throws:
java.lang.Exception
-
writeWrsDataRowColumn
protected void writeWrsDataRowColumn(WrsBindingItem item) throws java.lang.Exception
writeWrsDataRowColumn- Parameters:
item
- - binding item- Throws:
java.lang.Exception
-
writeWrsDataRowColumnValue
protected void writeWrsDataRowColumnValue(int jdbcColumnType, int colNum) throws java.lang.Exception
writeWrsDataRowColumnValue- Parameters:
jdbcColumnType
-colNum
- - starts with 1 (JDBC compliant)- Throws:
java.lang.Exception
-
writeWrsDataRowColumnAttributes
protected void writeWrsDataRowColumnAttributes(WrsBindingItem item) throws java.lang.Exception
Writes the attributes corresponding to wrs:A sub-nodes of a wrs:C Attributes are not written if their value was null- Parameters:
item
-- Throws:
java.lang.Exception
-
writeWrsErrorDuringQuery
protected void writeWrsErrorDuringQuery() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
writeWrsMaxRowsExceeded
protected void writeWrsMaxRowsExceeded(int maxRows) throws javax.xml.stream.XMLStreamException
writeWrsMaxRowsExceeded- Parameters:
maxRows
-- Throws:
javax.xml.stream.XMLStreamException
-
-