Package com.db4o.marshall
Interface WriteContext
-
- All Superinterfaces:
Context
,WriteBuffer
- All Known Implementing Classes:
MarshallingContext
public interface WriteContext extends Context, WriteBuffer
this interface is passed to internal classTypeHandler4
during marshaling and provides methods to marshal objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReservedBuffer
reserve(int length)
reserves a buffer with a specific length at the current position, to be written in a later step.void
writeObject(TypeHandler4 handler, java.lang.Object obj)
writes sub-objects, in cases where theTypeHandler4
is known.void
writeObject(java.lang.Object obj)
makes sure the object is stored and writes the ID of the object to the context.-
Methods inherited from interface com.db4o.marshall.Context
objectContainer, transaction
-
Methods inherited from interface com.db4o.marshall.WriteBuffer
writeByte, writeBytes, writeInt, writeLong
-
-
-
-
Method Detail
-
writeObject
void writeObject(java.lang.Object obj)
makes sure the object is stored and writes the ID of the object to the context. Use this method for first class objects only (objects that have an identity in the database). If the object can potentially be a primitive type, do not use this method but use a matchingWriteBuffer
method instead.- Parameters:
obj
- the object to write.
-
writeObject
void writeObject(TypeHandler4 handler, java.lang.Object obj)
writes sub-objects, in cases where theTypeHandler4
is known.- Parameters:
handler
- typehandler to be used to write the object.obj
- the object to write
-
reserve
ReservedBuffer reserve(int length)
reserves a buffer with a specific length at the current position, to be written in a later step.- Parameters:
length
- the length to be reserved.- Returns:
- the ReservedBuffer
-
-