org.clazzes.jdbc2xml.deserialization
Interface DeserializationHandler

All Known Implementing Classes:
AbstractSbDeserializationHandler, BigDecimalDeserializationHandler, BinaryDeserializationHandler, DateDeserializationHandler, DoubleDeserializationHandler, FloatDeserializationHandler, IntegerDeserializationHandler, StringDeserializationHandler, TimestampDeserializationHandler

public interface DeserializationHandler

A DeserializationHandler instance handles the deserialization of the CDATA of content of a tag to a database column.

Author:
wglas

Method Summary
 void addCharacters(char[] ch, int start, int length)
          Push characters received by ContentHandler.characters(char[], int, int) to the field content.
 void fillColumn(java.sql.PreparedStatement ps, int column)
          Fill the column of the given prepared statement with the data received so far.
 void startCharacters()
          Start receiving data.
 

Method Detail

startCharacters

void startCharacters()
Start receiving data. This is called as part of an ContentHandler.startElement(String, String, String, org.xml.sax.Attributes) operation.


addCharacters

void addCharacters(char[] ch,
                   int start,
                   int length)
Push characters received by ContentHandler.characters(char[], int, int) to the field content. This method throws an exception, startCharacters() has not been called before.

Parameters:
ch - The character array.
start - The start index of the data to push.
length - The length of the data to push.

fillColumn

void fillColumn(java.sql.PreparedStatement ps,
                int column)
                throws java.sql.SQLException
Fill the column of the given prepared statement with the data received so far. If no data has been received, i.e. startCharacters() has not been called before, set the column to an SQL null value. This call resets the state of this handler, so startCharacters() may be called again.

Parameters:
ps - The PreparedStatement to fill.
column - The number of the column to set.
Throws:
java.sql.SQLException


Copyright © 2007. All Rights Reserved.