Class SerializerSelector
- Namespace
- Stride.Core.Serialization
- Assembly
- Stride.Core.dll
Serializer context. It holds DataSerializer{T} objects and their factories.
public class SerializerSelector
- Inheritance
-
SerializerSelector
Constructors
SerializerSelector(bool, bool, params string[])
Initializes a new instance of the SerializerSelector class.
public SerializerSelector(bool reuseReferences, bool externalIdentifiableAsGuid, params string[] profiles)
Parameters
reuseReferencesboolif set to
truereuse references (allow cycles in the object graph).externalIdentifiableAsGuidboolprofilesstring[]The profiles.
SerializerSelector(params string[])
public SerializerSelector(params string[] profiles)
Parameters
profilesstring[]
Fields
SelectorOverride
public SerializerSelector SelectorOverride
Field Value
Properties
Asset
public static SerializerSelector Asset { get; }
Property Value
AssetWithReuse
public static SerializerSelector AssetWithReuse { get; }
Property Value
Default
Gets the default instance of Serializer.
public static SerializerSelector Default { get; }
Property Value
- SerializerSelector
The default instance.
ExternalIdentifiableAsGuid
Gets whether IIdentifiable instances marked as external will have only their Guid stored.
public bool ExternalIdentifiableAsGuid { get; }
Property Value
Profiles
public IEnumerable<string> Profiles { get; }
Property Value
ReuseReferences
Gets whether serialization reuses references, where each reference gets assigned an ID and if it is serialized again, same instance will be reused).
public bool ReuseReferences { get; }
Property Value
SerializerFactories
public List<SerializerFactory> SerializerFactories { get; }
Property Value
Methods
EnsureInitialized(DataSerializer)
Internal function, for use by SerializerFactory.
public void EnsureInitialized(DataSerializer dataSerializer)
Parameters
dataSerializerDataSerializerThe data serializer to initialize if not done yet
GetSerializer(ref ObjectId)
public DataSerializer GetSerializer(ref ObjectId typeId)
Parameters
typeIdObjectId
Returns
GetSerializer(Type)
Gets the serializer.
public DataSerializer GetSerializer(Type type)
Parameters
typeTypeThe type that you want to (de)serialize.
Returns
- DataSerializer
The DataSerializer<T> for this type if it exists or can be created, otherwise null.
GetSerializer<T>()
Gets the serializer.
public DataSerializer<T> GetSerializer<T>()
Returns
- DataSerializer<T>
The DataSerializer<T> for this type if it exists or can be created, otherwise null.
Type Parameters
TThe type that you want to (de)serialize.
HasProfile(string)
Checks if this instance supports the specified serialization profile.
public bool HasProfile(string profile)
Parameters
profilestringName of the profile
Returns
- bool
trueif this instance supports the specified serialization profile