|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sleepycat.bdb.bind.serial.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.
Constructor Summary | |
SerialBinding(SerialFormat format)
Creates a serial binding. |
Method Summary | |
Object |
dataToObject(DataBuffer data)
Converts a data buffer into an Object. |
Object |
dataToObject(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. |
Object |
objectToData(Object object)
Can be overridden to convert the object to a deserialized data object. |
void |
objectToData(Object object,
DataBuffer data)
Converts an Object into a data buffer. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SerialBinding(SerialFormat format)
format
- is the format of the new binding.Method Detail |
public Object dataToObject(DataBuffer data) throws IOException
DataBinding
dataToObject
in interface DataBinding
data
- is the source data buffer.
IOException
public void objectToData(Object object, DataBuffer data) throws IOException
DataBinding
objectToData
in interface DataBinding
object
- is the source Object.data
- is the destination data buffer.
IOException
public DataFormat getDataFormat()
DataBinding
getDataFormat
in interface DataBinding
public Object dataToObject(Object data) throws 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).
IOException
public Object objectToData(Object object) throws IOException
objectToData(Object,DataBuffer)
before serializing the object. The default implemention simply returns
the object parameter.
object
- is the source object.
IOException
|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |