Class FSTJSonUnmodifiableCollectionSerializer
java.lang.Object
org.nustaq.serialization.FSTBasicObjectSerializer
org.nustaq.serialization.serializers.FSTCollectionSerializer
org.nustaq.serialization.serializers.FSTJSonUnmodifiableCollectionSerializer
- All Implemented Interfaces:
FSTCrossPlatformSerialzer
,FSTObjectSerializer
For JSON only, see {@link <a href="https://github.com/RuedigerMoeller/fast-serialization/issues/114">Unable to deserialize unmodifiable collections from JSON}.
- Author:
- Jakub Kubrynski
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Class<?>
static final Class<?>
static final Class<?>
static final Class<?>
Fields inherited from interface org.nustaq.serialization.FSTObjectSerializer
REALLY_NULL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioninstantiate
(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) return null to delegate object instantiation to FST.void
writeObject
(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) write the contents of a given objectMethods inherited from class org.nustaq.serialization.FSTBasicObjectSerializer
alwaysCopy, readObject, willHandleClass, writeTupleEnd
-
Field Details
-
UNMODIFIABLE_COLLECTION_CLASS
-
UNMODIFIABLE_RANDOM_ACCESS_LIST_CLASS
-
UNMODIFIABLE_SET_CLASS
-
UNMODIFIABLE_LIST_CLASS
-
-
Constructor Details
-
FSTJSonUnmodifiableCollectionSerializer
public FSTJSonUnmodifiableCollectionSerializer()
-
-
Method Details
-
writeObject
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException Description copied from interface:FSTObjectSerializer
write the contents of a given object- Specified by:
writeObject
in interfaceFSTObjectSerializer
- Overrides:
writeObject
in classFSTCollectionSerializer
- Throws:
IOException
-
instantiate
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws Exception Description copied from interface:FSTObjectSerializer
return 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- Specified by:
instantiate
in interfaceFSTObjectSerializer
- Overrides:
instantiate
in classFSTCollectionSerializer
- Throws:
Exception
-