|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.bdb.bind.serial.SerialBinding
public class SerialBinding
A concrete serial binding for keys or values. This binding stores objects in serial data format. If this class is used "as is" the deserialized objects are returned by the binding, and these objects must be serializable.
The class may also be extended to override the dataToObject(Object)
and objectToData(Object)
methods in order to
map between the deserialized objects and other objects. In that case the
objects returned by the binding do not have to be serializable. Note that
both methods must be overridden.
Field Summary | |
---|---|
protected SerialFormat |
format
|
Constructor Summary | |
---|---|
SerialBinding(SerialFormat format)
Creates a serial binding. |
Method Summary | |
---|---|
java.lang.Object |
dataToObject(DataBuffer data)
Converts a data buffer into an Object. |
java.lang.Object |
dataToObject(java.lang.Object data)
Can be overridden to convert the deserialized data object to another object. |
DataFormat |
getDataFormat()
Returns the format used for the data of this binding. |
java.lang.Object |
objectToData(java.lang.Object object)
Can be overridden to convert the object to a deserialized data object. |
void |
objectToData(java.lang.Object object,
DataBuffer data)
Converts an Object into a data buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SerialFormat format
Constructor Detail |
---|
public SerialBinding(SerialFormat format)
format
- is the format of the new binding.Method Detail |
---|
public java.lang.Object dataToObject(DataBuffer data) throws java.io.IOException
DataBinding
dataToObject
in interface DataBinding
data
- is the source data buffer.
java.io.IOException
public void objectToData(java.lang.Object object, DataBuffer data) throws java.io.IOException
DataBinding
objectToData
in interface DataBinding
object
- is the source Object.data
- is the destination data buffer.
java.io.IOException
public DataFormat getDataFormat()
DataBinding
getDataFormat
in interface DataBinding
public java.lang.Object dataToObject(java.lang.Object data) throws java.io.IOException
dataToObject(DataBuffer)
after deserializing the data. The default implemention simply returns
the data parameter.
data
- is the deserialized data object (will always be
serializable).
java.io.IOException
public java.lang.Object objectToData(java.lang.Object object) throws java.io.IOException
objectToData(Object,DataBuffer)
before serializing the object. The default implemention simply returns
the object parameter.
object
- is the source object.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |