Package org.nustaq.serialization
Interface FSTObjectSerializer
- All Known Subinterfaces:
FSTCrossPlatformSerialzer
- All Known Implementing Classes:
FSTArrayListSerializer,FSTBasicObjectSerializer,FSTBigIntegerSerializer,FSTBigNumberSerializers.FSTByteSerializer,FSTBigNumberSerializers.FSTCharSerializer,FSTBigNumberSerializers.FSTDoubleSerializer,FSTBigNumberSerializers.FSTFloatSerializer,FSTBigNumberSerializers.FSTShortSerializer,FSTBitSetSerializer,FSTClassSerializer,FSTCollectionSerializer,FSTCPEnumSetSerializer,FSTCPThrowableSerializer,FSTDateSerializer,FSTEnumSetSerializer,FSTJSonSerializers.BigDecSerializer,FSTJSonUnmodifiableCollectionSerializer,FSTJSonUnmodifiableMapSerializer,FSTMapSerializer,FSTProxySerializer,FSTStringBufferSerializer,FSTStringBuilderSerializer,FSTStringSerializer,FSTThrowableSerializer,FSTTimestampSerializer
public interface FSTObjectSerializer
- See Also:
FSTBasicObjectSerializer
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREALLY_NULL -
Method Summary
Modifier and Type Method Description booleanalwaysCopy()java.lang.Objectinstantiate(java.lang.Class objectClass, FSTObjectInput fstObjectInput, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition)return null to delegate object instantiation to FST.voidreadObject(FSTObjectInput in, java.lang.Object toRead, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy)read the content to an already instantiated objectbooleanwillHandleClass(java.lang.Class cl)useful if you register for a class and its subclasses, but want to exclude a specific subclassvoidwriteObject(FSTObjectOutput out, java.lang.Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition)write the contents of a given object
-
Field Details
-
REALLY_NULL
static final java.lang.String REALLY_NULL- See Also:
- Constant Field Values
-
-
Method Details
-
writeObject
void writeObject(FSTObjectOutput out, java.lang.Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws java.io.IOExceptionwrite the contents of a given object- Throws:
java.io.IOException
-
readObject
void readObject(FSTObjectInput in, java.lang.Object toRead, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy) throws java.lang.Exceptionread the content to an already instantiated object- Throws:
java.lang.Exception
-
willHandleClass
boolean willHandleClass(java.lang.Class cl)useful if you register for a class and its subclasses, but want to exclude a specific subclass -
alwaysCopy
boolean alwaysCopy()- Returns:
- true if FST can skip a search for same instances in the serialized ObjectGraph. This speeds up reading and writing and makes sense for short immutable such as Integer, Short, Character, Date, .. . For those classes it is more expensive (CPU, size) to do a lookup than to just write the Object twice in case.
-
instantiate
java.lang.Object instantiate(java.lang.Class objectClass, FSTObjectInput fstObjectInput, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws java.lang.Exceptionreturn null to delegate object instantiation to FST. If you want to implement object instantiation yourself, usually you leave the readObject method empty and handle instantiation and reading the object here. You must call registerObjectForWrite immediately after creating it on the FSTObjectInput- Throws:
java.lang.Exception
-