Namespace: | Sirenix.Serialization |
Assembly: | Sirenix.Serialization |
public static class FormatterEmitter
NOTE: Some platforms do not support emitting. Check whether you can emit on the current platform using Sirenix.Serialization.Utilities.EmitUtilities.CanEmit.
public const string PRE_EMITTED_ASSEMBLY_NAME = "Sirenix.Serialization.AOTGenerated"
public const string RUNTIME_EMITTED_ASSEMBLY_NAME = "Sirenix.Serialization.RuntimeEmitted"
public static Type EmitAOTFormatter(Type formattedType, ModuleBuilder moduleBuilder, ISerializationPolicy policy)
System.Type | formattedType | Type to create a formatter for. |
System.Reflection.Emit.ModuleBuilder | moduleBuilder | The module builder to emit a formatter into. |
Sirenix.Serialization.ISerializationPolicy | policy | The serialization policy to use for creating the formatter. |
System.Type | The fully constructed, emitted formatter type. |
NOTE: Some platforms do not support emitting. On such platforms, this method logs an error and returns null. Check whether you can emit on the current platform using Sirenix.Serialization.Utilities.EmitUtilities.CanEmit.
public static IFormatter GetEmittedFormatter(Type type, ISerializationPolicy policy)
System.Type | type | The type to emit a formatter for. |
Sirenix.Serialization.ISerializationPolicy | policy | The serialization policy to use to determine which members the emitted formatter should serialize. If null, Strict is used. |
Sirenix.Serialization.IFormatter | The type of the emitted formatter. |
System.ArgumentNullException | The type argument is null. |