Class AssetObjectSerializerBackend
Internal class used when serializing/deserializing an object.
public class AssetObjectSerializerBackend : DefaultObjectSerializerBackend, IObjectSerializerBackend
- Inheritance
-
objectDefaultObjectSerializerBackendAssetObjectSerializerBackend
- Implements
-
IObjectSerializerBackend
- Inherited Members
-
DefaultObjectSerializerBackend.GetStyle(ref ObjectContext)DefaultObjectSerializerBackend.ReadYaml(ref ObjectContext)DefaultObjectSerializerBackend.WriteYaml(ref ObjectContext)
Constructors
AssetObjectSerializerBackend(ITypeDescriptorFactory)
public AssetObjectSerializerBackend(ITypeDescriptorFactory typeDescriptorFactory)
Parameters
typeDescriptorFactoryITypeDescriptorFactory
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
objectContextObjectContextclonebool
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
objectContextObjectContextThe object context.
valueobjectThe value.
itemTypeTypeType of the item.
indexint
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
objectContextObjectContextThe object context.
keyTypeTypeType 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
objectContextObjectContextThe object context.
valueTypeTypeType of the value.
keyobjectThe 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
objectContextObjectContextThe object context to which the member name.
memberNamestringName of the member read from the current yaml stream.
skipMemberbool
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
objectContextObjectContextThe object context.
memberDescriptorIMemberDescriptormemberValueobjectThe member value. See remarks
memberTypeTypeType 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
memberIMemberDescriptorThe member to evaluate.
objectContextObjectContextThe 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
objectContextObjectContextThe object context.
itemobjectThe item.
itemTypeTypeType of the item.
indexint
WriteDictionaryKey(ref ObjectContext, object, Type)
Writes the key of the dictionary item.
public override void WriteDictionaryKey(ref ObjectContext objectContext, object key, Type keyType)
Parameters
objectContextObjectContextThe object context.
keyobjectThe key of the dictionary item.
keyTypeTypeType 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
objectContextObjectContextThe object context.
keyobjectvalueobjectThe value of the dictionary item.
valueTypeTypeType 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
objectContextObjectContextThe object context.
memberIMemberDescriptorThe member.
memberNamestringName 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)
Parameters
objectContextObjectContextThe object context.
memberDescriptorIMemberDescriptormemberValueobjectThe member value.
memberTypeTypeType of the member.