org.objectweb.cjdbc.common.sql.filters
Class AbstractBlobFilter

java.lang.Object
  extended byorg.objectweb.cjdbc.common.sql.filters.AbstractBlobFilter
Direct Known Subclasses:
Base64Filter, BlobEscapedFilter, HexaBlobFilter, NoneBlobFilter

public abstract class AbstractBlobFilter
extends java.lang.Object

This class defines a BlobFilterInterface. All implementing interface should satisfy the following: - Implementation is not dependant of the database - decode(encode(data)) = data

Version:
1.0
Author:
Nicolas Modrzyk , Emmanuel Cecchet

Constructor Summary
AbstractBlobFilter()
           
 
Method Summary
abstract  byte[] decode(byte[] data)
          Decode the blob data from the database.
abstract  byte[] decode(java.lang.String data)
          Decode the blob data from the database.
abstract  java.lang.String encode(byte[] data)
          Encode the blob data in a form that is independant of the database.
abstract  java.lang.String encode(java.lang.String data)
          Encode the blob data in a form that is independant of the database.
static AbstractBlobFilter getBlobFilterInstance(java.lang.String blobEncodingMethod)
          Get an instance of an AbstractBlobFilter given the blobEndodingMethod description.
abstract  java.lang.String getXml()
          Get the XML attribute value of the filter as defined in the DTD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBlobFilter

public AbstractBlobFilter()
Method Detail

getBlobFilterInstance

public static AbstractBlobFilter getBlobFilterInstance(java.lang.String blobEncodingMethod)
Get an instance of an AbstractBlobFilter given the blobEndodingMethod description. Currently supported are:
hexa
none
escaped
If the parameter specified is not appropriate then a NoneBlobFilter instance is returned.

Parameters:
blobEncodingMethod - the string description
Returns:
AbstractBlobFilter instance

encode

public abstract java.lang.String encode(byte[] data)
Encode the blob data in a form that is independant of the database.

Parameters:
data - the byte array to convert
Returns:
String object is returned for convenience as this is the way it is going to be handled afterwards.

encode

public abstract java.lang.String encode(java.lang.String data)
Encode the blob data in a form that is independant of the database.

Parameters:
data - the byte array to convert
Returns:
String object is returned for convenience as this is the way it is going to be handled afterwards.

decode

public abstract byte[] decode(byte[] data)
Decode the blob data from the database. This must done in a database independant manner.

Parameters:
data - the data to decode
Returns:
byte[] decoded byte array of data

decode

public abstract byte[] decode(java.lang.String data)
Decode the blob data from the database. This must done in a database independant manner.

Parameters:
data - the data to decode
Returns:
byte[] decoded byte array of data

getXml

public abstract java.lang.String getXml()
Get the XML attribute value of the filter as defined in the DTD.

Returns:
XML attribute value


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.