Class HumlGeneratedContext

Namespace
Huml.Net.Serialization
Assembly
Huml.Net.dll

Abstract base class for source-generated HUML serialisation contexts. Subclass with partial and annotate with [HumlSerializable(typeof(T))] to register types; the source generator will emit the HumlTypeInfo<T> implementations.

public abstract class HumlGeneratedContext : IHumlTypeInfoResolver
Inheritance
HumlGeneratedContext
Implements
Inherited Members

Examples

[HumlSerializable(typeof(WeatherForecast))]
public partial class MyContext : HumlGeneratedContext { }

Methods

GetTypeInfo(Type, HumlOptions)

Returns type metadata for type, or null if this context does not handle that type. Source-generated subclasses override this method to dispatch by registered type.

public abstract HumlTypeInfo? GetTypeInfo(Type type, HumlOptions options)

Parameters

type Type
options HumlOptions

Returns

HumlTypeInfo

GetTypeInfo<T>()

Returns strongly-typed metadata for T, or null if this context does not handle that type.

public virtual HumlTypeInfo<T>? GetTypeInfo<T>()

Returns

HumlTypeInfo<T>

Type Parameters

T