Interface ITypeDescriber

The interface used to discover the members to (de)serialize for a type.

DefaultTypeDescriber, ManualTypeDescriber, and SurrogateTypeDescriber all implement this interface and handle the most common desired configurations.

Note to implementors: All ITypeDescriber methods must be thread safe, as they are invoked as needed during operation with no guarantee about the calling thread(s).

Namespace: Cesil
Assembly: Cesil.dll
Syntax
public interface ITypeDescriber

Methods

EnumerateMembersToDeserialize(TypeInfo)

Enumerate all the members on forType to deserialize.

Declaration
IEnumerable<DeserializableMember> EnumerateMembersToDeserialize(TypeInfo forType)
Parameters
Type Name Description
System.Reflection.TypeInfo forType
Returns
Type Description
System.Collections.Generic.IEnumerable<DeserializableMember>

EnumerateMembersToSerialize(TypeInfo)

Enumerate all the members on forType to serialize.

Declaration
IEnumerable<SerializableMember> EnumerateMembersToSerialize(TypeInfo forType)
Parameters
Type Name Description
System.Reflection.TypeInfo forType
Returns
Type Description
System.Collections.Generic.IEnumerable<SerializableMember>

GetCellsForDynamicRow(WriteContext, Object, Span<DynamicCellValue>)

Called to determine the cells that make up the given dynamic row.

Returns the number of cells extracted from the row. If the given span is too small, its contents are ignored and GetCellsForDynamicRow is called again with one of at least the indicated size.

The content of the given span is undefined, in particular no values are guaranteed to be carried forward between calls.

Declaration
int GetCellsForDynamicRow(in WriteContext context, object row, Span<DynamicCellValue> cells)
Parameters
Type Name Description
WriteContext context
System.Object row
System.Span<DynamicCellValue> cells
Returns
Type Description
System.Int32

GetDynamicCellParserFor(ReadContext, TypeInfo)

Called to determine how to convert a dynamic cell.

Returns null if no Parser could be found.

Declaration
Parser GetDynamicCellParserFor(in ReadContext context, TypeInfo targetType)
Parameters
Type Name Description
ReadContext context
System.Reflection.TypeInfo targetType
Returns
Type Description
Parser

GetDynamicRowConverter(ReadContext, IEnumerable<ColumnIdentifier>, TypeInfo)

Called to determine how to convert an entire dynamic row into the given type.

Returns null if no DynamicRowConverter could be found.

Declaration
DynamicRowConverter GetDynamicRowConverter(in ReadContext context, IEnumerable<ColumnIdentifier> columns, TypeInfo targetType)
Parameters
Type Name Description
ReadContext context
System.Collections.Generic.IEnumerable<ColumnIdentifier> columns
System.Reflection.TypeInfo targetType
Returns
Type Description
DynamicRowConverter

GetInstanceProvider(TypeInfo)

Get the provider for instances of forType.

Returns null if no InstanceProvider could be found.

Declaration
InstanceProvider GetInstanceProvider(TypeInfo forType)
Parameters
Type Name Description
System.Reflection.TypeInfo forType
Returns
Type Description
InstanceProvider
In This Article
Back to top Generated by DocFX