Version 2.1.0.0

FormatterLocator class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public static class FormatterLocator
Utility class for locating and caching formatters for all non-primitive types.
Inheritance
  • System.Object
  • FormatterLocator

Methods

GetFormatter(Type, ISerializationPolicy)
Gets a formatter for a given type.
public static IFormatter GetFormatter(Type type, ISerializationPolicy policy)
Parameters
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.

Returns
Sirenix.Serialization.IFormatter

A formatter for the given type.

Exceptions
System.ArgumentNullException

The type argument is null.

GetFormatter<T>(ISerializationPolicy)
Gets a formatter for the type .
public static IFormatter<T> GetFormatter<T>(ISerializationPolicy policy)
Parameters
Sirenix.Serialization.ISerializationPolicy policy

The serialization policy to use if a formatter has to be emitted. If null, Strict is used.

Returns
Sirenix.Serialization.IFormatter<T>

A formatter for the type .

Type Parameters
T

The type to get a formatter for.

Events

OnLocatedEmittableFormatterForType
Editor-only event that fires whenever an emittable formatter has been located. This event is used by the AOT formatter pre-emitter to locate types that need to have formatters pre-emitted.
public static event Action<Type> OnLocatedEmittableFormatterForType
OnLocatedFormatter
Editor-only event that fires whenever a formatter has been located.
public static event Action<IFormatter> OnLocatedFormatter

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.