public class MarshalledObjField extends AbstractDataObjField
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 and Description |
---|
MarshalledObjField(int index,
String name) |
Modifier and Type | Method and Description |
---|---|
Object |
parseString(String value)
Parses string representation of specified field value.
|
Object |
readObj(com.devexperts.io.BufferedInput in)
Reads field value from specified data input and returns it to the caller.
|
Object |
readObj(DataInput in)
Reads field value from specified data input and returns it to the caller.
|
String |
toString(Object value)
Returns string representation of the specified field value.
|
void |
writeObj(com.devexperts.io.BufferedOutput out,
Object value)
Writes specified field value into specified buffered output.
|
void |
writeObj(DataOutput out,
Object value)
Writes specified field value into specified data output.
|
equals, getString, read, setString, write
getDefaultPropertyName, getIndex, getLocalName, getName, getPropertyName, getRecord, getSerialType, setRecord, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIndex, getLocalName, getName, getPropertyName, getRecord, getSerialType
public MarshalledObjField(int index, String name)
public final void writeObj(DataOutput out, Object value) throws IOException
DataObjField
IOException
- as specified data output does.public final void writeObj(com.devexperts.io.BufferedOutput out, Object value) throws IOException
DataObjField
IOException
- as specified data output does.public final Object readObj(DataInput in) throws IOException
DataObjField
IOException
- as specified data input does.public final Object readObj(com.devexperts.io.BufferedInput in) throws IOException
DataObjField
IOException
- as specified data input does.public String toString(Object value)
AbstractDataObjField
String.valueOf(value)
.toString
in interface DataObjField
toString
in class AbstractDataObjField
public Object parseString(String value)
AbstractDataObjField
value
.parseString
in interface DataObjField
parseString
in class AbstractDataObjField
Copyright © 2002–2025 Devexperts LLC. All rights reserved.