Class 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 Detail

      • WRS_XML_NAMESPACE

        public static final java.lang.String WRS_XML_NAMESPACE
        See Also:
        Constant Field Values
    • Constructor Detail

      • WrsDataWriter

        public WrsDataWriter()
        WrsDataWriter. Create the writer without parameters - caller should overwrite the method getStream().
      • WrsDataWriter

        public WrsDataWriter​(javax.xml.stream.XMLStreamWriter writer)
        WrsDataWriter
        Parameters:
        writer -
    • 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 interface IDataWriter
        Throws:
        java.lang.Exception
        See Also:
        IDataWriter.close()
      • 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