Class AssetObjectSerializerBackend
Internal class used when serializing/deserializing an object.
public class AssetObjectSerializerBackend : DefaultObjectSerializerBackend, IObjectSerializerBackend
- Inheritance
-
DefaultObjectSerializerBackendAssetObjectSerializerBackend
- Implements
-
IObjectSerializerBackend
- Inherited Members
-
DefaultObjectSerializerBackend.GetStyle(ref ObjectContext)DefaultObjectSerializerBackend.ReadYaml(ref ObjectContext)DefaultObjectSerializerBackend.WriteYaml(ref ObjectContext)
Constructors
AssetObjectSerializerBackend(ITypeDescriptorFactory)
public AssetObjectSerializerBackend(ITypeDescriptorFactory typeDescriptorFactory)
Parameters
typeDescriptorFactory
ITypeDescriptorFactory
Fields
ObjectReferencesKey
public static readonly PropertyKey<YamlAssetMetadata<Guid>> ObjectReferencesKey
Field Value
OverrideDictionaryKey
public static readonly PropertyKey<YamlAssetMetadata<OverrideType>> OverrideDictionaryKey
Field Value
Methods
GetCurrentPath(ref ObjectContext, bool)
public static YamlAssetPath GetCurrentPath(ref ObjectContext objectContext, bool clone)
Parameters
objectContext
ObjectContextclone
bool
Returns
ReadCollectionItem(ref ObjectContext, object, Type, int)
Reads the collection item from the current YAML stream.
public override object ReadCollectionItem(ref ObjectContext objectContext, object value, Type itemType, int index)
Parameters
objectContext
ObjectContextThe object context.
value
objectThe value.
itemType
TypeType of the item.
index
int
Returns
- object
The collection item read from YAML stream.
ReadDictionaryKey(ref ObjectContext, Type)
Reads the key of the dictionary item from the current YAML stream.
public override object ReadDictionaryKey(ref ObjectContext objectContext, Type keyType)
Parameters
objectContext
ObjectContextThe object context.
keyType
TypeType of the key.
Returns
- object
The key of the dictionary item read from YAML stream.
ReadDictionaryValue(ref ObjectContext, Type, object)
Reads the value of the dictionary item from the current YAML stream.
public override object ReadDictionaryValue(ref ObjectContext objectContext, Type valueType, object key)
Parameters
objectContext
ObjectContextThe object context.
valueType
TypeType of the value.
key
objectThe key corresponding to the value.
Returns
- object
The value of the dictionary item read from YAML stream.
ReadMemberName(ref ObjectContext, string, out bool)
Allows to transform the name of the member while reading for the specified object context.
public override string ReadMemberName(ref ObjectContext objectContext, string memberName, out bool skipMember)
Parameters
objectContext
ObjectContextThe object context to which the member name.
memberName
stringName of the member read from the current yaml stream.
skipMember
bool
Returns
- string
The name that will be used to get the Stride.Core.Reflection.IMemberDescriptor from the current object context.
ReadMemberValue(ref ObjectContext, IMemberDescriptor, object, Type)
Reads the value for the specified member from the current YAML stream.
public override object ReadMemberValue(ref ObjectContext objectContext, IMemberDescriptor memberDescriptor, object memberValue, Type memberType)
Parameters
objectContext
ObjectContextThe object context.
memberDescriptor
IMemberDescriptormemberValue
objectThe member value. See remarks
memberType
TypeType of the member.
Returns
- object
The value read from YAML stream.
Remarks
TODO: Explain memberValue when can be not null
ShouldSerialize(IMemberDescriptor, ref ObjectContext)
Indicates if the given member should be serialized.
public override bool ShouldSerialize(IMemberDescriptor member, ref ObjectContext objectContext)
Parameters
member
IMemberDescriptorThe member to evaluate.
objectContext
ObjectContextThe object context.
Returns
- bool
True if the member should be serialized, False otherwise.
WriteCollectionItem(ref ObjectContext, object, Type, int)
Writes the collection item.
public override void WriteCollectionItem(ref ObjectContext objectContext, object item, Type itemType, int index)
Parameters
objectContext
ObjectContextThe object context.
item
objectThe item.
itemType
TypeType of the item.
index
int
WriteDictionaryKey(ref ObjectContext, object, Type)
Writes the key of the dictionary item.
public override void WriteDictionaryKey(ref ObjectContext objectContext, object key, Type keyType)
Parameters
objectContext
ObjectContextThe object context.
key
objectThe key of the dictionary item.
keyType
TypeType of the key.
WriteDictionaryValue(ref ObjectContext, object, object, Type)
Writes the value of the dictionary item.
public override void WriteDictionaryValue(ref ObjectContext objectContext, object key, object value, Type valueType)
Parameters
objectContext
ObjectContextThe object context.
key
objectvalue
objectThe value of the dictionary item.
valueType
TypeType of the value.
WriteMemberName(ref ObjectContext, IMemberDescriptor, string)
Writes the name of the member.
public override void WriteMemberName(ref ObjectContext objectContext, IMemberDescriptor member, string memberName)
Parameters
objectContext
ObjectContextThe object context.
member
IMemberDescriptorThe member.
memberName
stringName of the member.
WriteMemberValue(ref ObjectContext, IMemberDescriptor, object, Type)
Writes the member value.
public override void WriteMemberValue(ref ObjectContext objectContext, IMemberDescriptor memberDescriptor, object memberValue, Type memberType)