public class MarshallingContext extends java.lang.Object implements MarshallingInfo, WriteContext
| Constructor and Description |
|---|
MarshallingContext(Transaction trans,
ObjectReference ref,
UpdateDepth updateDepth,
boolean isNew) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexEntry(FieldMetadata fieldMetadata,
java.lang.Object obj) |
Slot |
allocateNewSlot(int length) |
Pointer4 |
allocateSlot() |
void |
beginSlot() |
ReadBuffer |
buffer() |
Config4Class |
classConfiguration() |
ClassMetadata |
classMetadata() |
ObjectContainerBase |
container() |
void |
createChildBuffer(boolean storeLengthInLink) |
void |
createIndirectionWithinSlot() |
void |
createIndirectionWithinSlot(TypeHandler4 handler) |
java.lang.Object |
currentIndexEntry() |
MarshallingContextState |
currentState() |
void |
debugPrependNextWrite(ByteArrayBuffer prepend) |
void |
debugWriteEnd(byte b) |
int |
declaredAspectCount() |
void |
declaredAspectCount(int count) |
java.lang.Object |
getObject() |
boolean |
isNew() |
boolean |
isNull(int fieldIndex) |
void |
isNull(int fieldIndex,
boolean flag) |
int |
marshalledLength() |
ObjectContainer |
objectContainer() |
int |
objectID() |
void |
purgeFieldIndexEntriesOnUpdate(Transaction transaction,
ArrayType arrayType) |
ObjectReference |
reference() |
int |
requiredLength(MarshallingBuffer buffer,
boolean align) |
ReservedBuffer |
reserve(int length)
reserves a buffer with a specific length at the current
position, to be written in a later step.
|
void |
restoreState(MarshallingContextState state) |
ByteArrayBuffer |
toWriteBuffer(Pointer4 pointer) |
Transaction |
transaction() |
UpdateDepth |
updateDepth() |
void |
updateDepth(UpdateDepth depth) |
void |
writeByte(byte b)
writes a single byte to the buffer.
|
void |
writeBytes(byte[] bytes)
writes an array of bytes to the buffer
|
void |
writeDeclaredAspectCount(int count) |
void |
writeInt(int i)
writes an int to the buffer.
|
void |
writeLong(long l)
writes a long to the buffer
|
void |
writeObject(java.lang.Object obj)
makes sure the object is stored and writes the ID of
the object to the context.
|
void |
writeObject(TypeHandler4 handler,
java.lang.Object obj)
writes sub-objects, in cases where the
TypeHandler4 is known. |
void |
writeObjectWithCurrentState(TypeHandler4 handler,
java.lang.Object obj) |
public MarshallingContext(Transaction trans, ObjectReference ref, UpdateDepth updateDepth, boolean isNew)
public ClassMetadata classMetadata()
classMetadata in interface MarshallingInfopublic boolean isNew()
public boolean isNull(int fieldIndex)
isNull in interface MarshallingInfopublic void isNull(int fieldIndex,
boolean flag)
public Transaction transaction()
transaction in interface Contextpublic Slot allocateNewSlot(int length)
public Pointer4 allocateSlot()
public ByteArrayBuffer toWriteBuffer(Pointer4 pointer)
public int marshalledLength()
public int requiredLength(MarshallingBuffer buffer, boolean align)
public java.lang.Object getObject()
public Config4Class classConfiguration()
public UpdateDepth updateDepth()
public void updateDepth(UpdateDepth depth)
public int objectID()
public java.lang.Object currentIndexEntry()
public ObjectContainerBase container()
public ObjectContainer objectContainer()
objectContainer in interface Contextpublic void writeByte(byte b)
WriteBufferwriteByte in interface WriteBufferb - the bytepublic void writeBytes(byte[] bytes)
WriteBufferwriteBytes in interface WriteBufferbytes - the byte arraypublic void writeInt(int i)
WriteBufferwriteInt in interface WriteBufferi - the intpublic void writeLong(long l)
WriteBufferwriteLong in interface WriteBufferl - the longpublic void createChildBuffer(boolean storeLengthInLink)
public void beginSlot()
beginSlot in interface MarshallingInfopublic void writeDeclaredAspectCount(int count)
public void debugPrependNextWrite(ByteArrayBuffer prepend)
public void debugWriteEnd(byte b)
public void writeObject(java.lang.Object obj)
WriteContextWriteBuffer method instead.writeObject in interface WriteContextobj - the object to write.public void writeObject(TypeHandler4 handler, java.lang.Object obj)
WriteContextTypeHandler4 is known.writeObject in interface WriteContexthandler - typehandler to be used to write the object.obj - the object to writepublic void writeObjectWithCurrentState(TypeHandler4 handler, java.lang.Object obj)
public void addIndexEntry(FieldMetadata fieldMetadata, java.lang.Object obj)
public void purgeFieldIndexEntriesOnUpdate(Transaction transaction, ArrayType arrayType)
public ObjectReference reference()
public void createIndirectionWithinSlot(TypeHandler4 handler)
public void createIndirectionWithinSlot()
public ReadBuffer buffer()
buffer in interface MarshallingInfopublic MarshallingContextState currentState()
public void restoreState(MarshallingContextState state)
public ReservedBuffer reserve(int length)
WriteContextreserve in interface WriteContextlength - the length to be reserved.public int declaredAspectCount()
declaredAspectCount in interface AspectVersionContextpublic void declaredAspectCount(int count)
declaredAspectCount in interface AspectVersionContext