EGDL2 2.1
Loading...
Searching...
No Matches
FullSerializer.fsObjectProcessor Class Referenceabstract

Inherited by FullSerializer.Internal.fsSerializationCallbackProcessor.

Public Member Functions

virtual bool CanProcess (Type type)
 Is the processor interested in objects of the given type?
 
virtual void OnBeforeSerialize (Type storageType, object instance)
 Called before serialization.
 
virtual void OnAfterSerialize (Type storageType, object instance, ref fsData data)
 Called after serialization.
 
virtual void OnBeforeDeserialize (Type storageType, ref fsData data)
 Called before deserialization.
 
virtual void OnBeforeDeserializeAfterInstanceCreation (Type storageType, object instance, ref fsData data)
 Called before deserialization has begun but after the object instance has been created. This will get invoked even if the user passed in an existing instance.
 
virtual void OnAfterDeserialize (Type storageType, object instance)
 Called after deserialization.
 

Detailed Description

Enables injecting code before/after an object has been serialized. This is most useful if you want to run the default serialization process but apply a pre/post processing step.

Multiple object processors can be active at the same time. When running they are called in a "nested" fashion - if we have processor1 and process2 added to the serializer in that order (p1 then p2), then the execution order will be p1::Before p2::Before /serialization/ p2::After p1::After.

Member Function Documentation

◆ CanProcess()

virtual bool FullSerializer.fsObjectProcessor.CanProcess ( Type type)
inlinevirtual

Is the processor interested in objects of the given type?

Parameters
typeThe given type.
Returns
True if the processor should be applied, false otherwise.

◆ OnAfterDeserialize()

virtual void FullSerializer.fsObjectProcessor.OnAfterDeserialize ( Type storageType,
object instance )
inlinevirtual

Called after deserialization.

Parameters
storageTypeThe field/property type that is storing the instance.
instanceThe type of the instance.

◆ OnAfterSerialize()

virtual void FullSerializer.fsObjectProcessor.OnAfterSerialize ( Type storageType,
object instance,
ref fsData data )
inlinevirtual

Called after serialization.

Parameters
storageTypeThe field/property type that is storing the instance.
instanceThe type of the instance.
dataThe data that was serialized.

◆ OnBeforeDeserialize()

virtual void FullSerializer.fsObjectProcessor.OnBeforeDeserialize ( Type storageType,
ref fsData data )
inlinevirtual

Called before deserialization.

Parameters
storageTypeThe field/property type that is storing the instance.
dataThe data that will be used for deserialization.

◆ OnBeforeDeserializeAfterInstanceCreation()

virtual void FullSerializer.fsObjectProcessor.OnBeforeDeserializeAfterInstanceCreation ( Type storageType,
object instance,
ref fsData data )
inlinevirtual

Called before deserialization has begun but after the object instance has been created. This will get invoked even if the user passed in an existing instance.

IMPORTANT: The actual instance that gets passed here is not guaranteed to be an a subtype of storageType, since the value for instance is whatever the active converter returned for CreateInstance() - ie, some converters will return dummy types in CreateInstance() if instance creation cannot be separated from deserialization (ie, KeyValuePair).

Parameters
storageTypeThe field/property type that is storing the instance.
instanceThe created object instance. No deserialization has been applied to it.
dataThe data that will be used for deserialization.

◆ OnBeforeSerialize()

virtual void FullSerializer.fsObjectProcessor.OnBeforeSerialize ( Type storageType,
object instance )
inlinevirtual

Called before serialization.

Parameters
storageTypeThe field/property type that is storing the instance.
instanceThe type of the instance.

The documentation for this class was generated from the following file: