Namespace: | Sirenix.Serialization |
Assembly: | Sirenix.Serialization |
public static class FormatterLocator
public static IFormatter GetFormatter(Type type, ISerializationPolicy policy)
System.Type | type | The type to get a formatter for. |
Sirenix.Serialization.ISerializationPolicy | policy | The serialization policy to use if a formatter has to be emitted. If null, Strict is used. |
Sirenix.Serialization.IFormatter | A formatter for the given type. |
System.ArgumentNullException | The type argument is null. |
public static IFormatter GetFormatter(Type type, ISerializationPolicy policy, bool allowWeakFallbackFormatters)
System.Type | type | The type to get a formatter for. |
Sirenix.Serialization.ISerializationPolicy | policy | The serialization policy to use if a formatter has to be emitted. If null, Strict is used. |
System.Boolean | allowWeakFallbackFormatters | Whether to allow the use of weak fallback formatters which do not implement the strongly typed Sirenix.Serialization.IFormatter<T>, but which conversely do not need to have had AOT support generated. |
Sirenix.Serialization.IFormatter | A formatter for the given type. |
System.ArgumentNullException | The type argument is null. |
public static IFormatter<T> GetFormatter<T>(ISerializationPolicy policy)
Sirenix.Serialization.ISerializationPolicy | policy | The serialization policy to use if a formatter has to be emitted. If null, Strict is used. |
Sirenix.Serialization.IFormatter<T> |
A formatter for the type |
T | The type to get a formatter for. |
public static event Action<Type> OnLocatedEmittableFormatterForType
public static event Action<IFormatter> OnLocatedFormatter