Class FSTJSonUnmodifiableCollectionSerializer
java.lang.Object
org.nustaq.serialization.FSTBasicObjectSerializer
org.nustaq.serialization.serializers.FSTCollectionSerializer
org.nustaq.serialization.serializers.FSTJSonUnmodifiableCollectionSerializer
- All Implemented Interfaces:
FSTCrossPlatformSerialzer,FSTObjectSerializer
public class FSTJSonUnmodifiableCollectionSerializer extends FSTCollectionSerializer
For JSON only, see {@link Unable to deserialize unmodifiable collections from JSON}.
- Author:
- Jakub Kubrynski
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<?>UNMODIFIABLE_COLLECTION_CLASSstatic java.lang.Class<?>UNMODIFIABLE_LIST_CLASSstatic java.lang.Class<?>UNMODIFIABLE_RANDOM_ACCESS_LIST_CLASSstatic java.lang.Class<?>UNMODIFIABLE_SET_CLASS -
Constructor Summary
Constructors Constructor Description FSTJSonUnmodifiableCollectionSerializer() -
Method Summary
Modifier and Type Method Description java.lang.Objectinstantiate(java.lang.Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition)return null to delegate object instantiation to FST.voidwriteObject(FSTObjectOutput out, java.lang.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
public static final java.lang.Class<?> UNMODIFIABLE_COLLECTION_CLASS -
UNMODIFIABLE_RANDOM_ACCESS_LIST_CLASS
public static final java.lang.Class<?> UNMODIFIABLE_RANDOM_ACCESS_LIST_CLASS -
UNMODIFIABLE_SET_CLASS
public static final java.lang.Class<?> UNMODIFIABLE_SET_CLASS -
UNMODIFIABLE_LIST_CLASS
public static final java.lang.Class<?> UNMODIFIABLE_LIST_CLASS
-
-
Constructor Details
-
FSTJSonUnmodifiableCollectionSerializer
public FSTJSonUnmodifiableCollectionSerializer()
-
-
Method Details
-
writeObject
public void writeObject(FSTObjectOutput out, java.lang.Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws java.io.IOExceptionDescription copied from interface:FSTObjectSerializerwrite the contents of a given object- Specified by:
writeObjectin interfaceFSTObjectSerializer- Overrides:
writeObjectin classFSTCollectionSerializer- Throws:
java.io.IOException
-
instantiate
public java.lang.Object instantiate(java.lang.Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws java.lang.ExceptionDescription copied from interface:FSTObjectSerializerreturn 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:
instantiatein interfaceFSTObjectSerializer- Overrides:
instantiatein classFSTCollectionSerializer- Throws:
java.lang.Exception
-