com.devexperts.qd.kit
Class MarshalledObjField

java.lang.Object
  extended by com.devexperts.qd.kit.AbstractDataField
      extended by com.devexperts.qd.kit.AbstractDataObjField
          extended by com.devexperts.qd.kit.MarshalledObjField
All Implemented Interfaces:
DataField, DataObjField

public class MarshalledObjField
extends AbstractDataObjField

The MarshalledObjField represents an object field with plain Java serialized form. After reading from DataInput the object is stored in Marshalled class, so that [slow] deseralization can be perfromed only when needed. It uses standard Java object serialization. Note that this serialization is highly ineffective and shall be substituted with more effective specialized version. It is recommended to use ByteArrayField with custom serialization whenever possible.

Whenever the code is written to work with this field type, one should use Marshalled.unwrap(java.lang.Object) to correctly handle the case of the naked object being received locally from the same JVM and Marshalled that was received from somewhere else.


Constructor Summary
MarshalledObjField(int index, java.lang.String name)
           
 
Method Summary
 java.lang.Object readObj(com.devexperts.io.BufferedInput in)
          Reads field value from specified data input and returns it to the caller.
 java.lang.Object readObj(java.io.DataInput in)
          Reads field value from specified data input and returns it to the caller.
 void writeObj(com.devexperts.io.BufferedOutput out, java.lang.Object value)
          Writes specified field value into specified buffered output.
 void writeObj(java.io.DataOutput out, java.lang.Object value)
          Writes specified field value into specified data output.
 
Methods inherited from class com.devexperts.qd.kit.AbstractDataObjField
equals, parseString, toString
 
Methods inherited from class com.devexperts.qd.kit.AbstractDataField
getIndex, getLocalName, getName, getRecord, getSerialType, setRecord, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.devexperts.qd.DataField
getIndex, getLocalName, getName, getRecord, getSerialType
 

Constructor Detail

MarshalledObjField

public MarshalledObjField(int index,
                          java.lang.String name)
Method Detail

writeObj

public final void writeObj(java.io.DataOutput out,
                           java.lang.Object value)
                    throws java.io.IOException
Description copied from interface: DataObjField
Writes specified field value into specified data output.

Throws:
java.io.IOException - as specified data output does.

writeObj

public final void writeObj(com.devexperts.io.BufferedOutput out,
                           java.lang.Object value)
                    throws java.io.IOException
Description copied from interface: DataObjField
Writes specified field value into specified buffered output.

Throws:
java.io.IOException - as specified data output does.

readObj

public final java.lang.Object readObj(java.io.DataInput in)
                               throws java.io.IOException
Description copied from interface: DataObjField
Reads field value from specified data input and returns it to the caller.

Throws:
java.io.IOException - as specified data input does.

readObj

public final java.lang.Object readObj(com.devexperts.io.BufferedInput in)
                               throws java.io.IOException
Description copied from interface: DataObjField
Reads field value from specified data input and returns it to the caller.

Throws:
java.io.IOException - as specified data input does.