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
reuseReferences
boolif set to
true
reuse references (allow cycles in the object graph).externalIdentifiableAsGuid
boolprofiles
string[]The profiles.
SerializerSelector(params string[])
public SerializerSelector(params string[] profiles)
Parameters
profiles
string[]
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
dataSerializer
DataSerializerThe data serializer to initialize if not done yet
GetSerializer(ref ObjectId)
public DataSerializer GetSerializer(ref ObjectId typeId)
Parameters
typeId
ObjectId
Returns
GetSerializer(Type)
Gets the serializer.
public DataSerializer GetSerializer(Type type)
Parameters
type
TypeThe 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
T
The type that you want to (de)serialize.
HasProfile(string)
Checks if this instance supports the specified serialization profile.
public bool HasProfile(string profile)
Parameters
profile
stringName of the profile
Returns
- bool
true
if this instance supports the specified serialization profile