org.clazzes.jdbc2xml.serialization
Interface SerializationHandler

All Known Implementing Classes:
BigDecimalSerializationHandler, BinarySerializationHandler, BooleanSerializationHandler, DateSerializationHandler, DoubleSerializationHandler, FloatSerializationHandler, IntegerSerializationHandler, StringSerializationHandler, TimestampSerializationHandler

public interface SerializationHandler

A SerializationHandler instance handles the serialization of a database column to the CDATA content of an XML tag.

Author:
wglas

Method Summary
 void fetchData(ResultSet rs, int column)
          Set the data to be serialized from the given column of an SQL result set.
 boolean isNull()
           
 void pushData(ContentHandler handler)
          Write the data of the database value to the CDATA content of the currently open tag by calling ContentHandler.characters(char[], int, int).
 

Method Detail

fetchData

void fetchData(ResultSet rs,
               int column)
               throws SQLException
Set the data to be serialized from the given column of an SQL result set. After this call, isNull() or fetchData(ResultSet, int) may be called.

Throws:
SQLException

isNull

boolean isNull()
Returns:
Whether the data received through fetchData(ResultSet, int) is a SQL null value.

pushData

void pushData(ContentHandler handler)
              throws SAXException
Write the data of the database value to the CDATA content of the currently open tag by calling ContentHandler.characters(char[], int, int). This call resets the state of this handler, so fetchData(ResultSet, int) my be called again.

Parameters:
handler - The ContentHandler to push the characters to.
Throws:
SAXException


Copyright © 2012. All Rights Reserved.