public virtual IFieldHandler CreateFromType(Type type, FieldHandlerOptions options)
{
if (EnumFieldHandler.IsCompatibleWith(type))
{
return(new EnumFieldHandler(type));
}
foreach (var fieldHandler in BasicSerializersFactory.FieldHandlers)
{
if (fieldHandler.IsCompatibleWith(type, options))
{
return(fieldHandler);
}
}
if (ListFieldHandler.IsCompatibleWith(type))
{
return(new ListFieldHandler(_provider.FieldHandlerFactory, _provider.TypeConvertorGenerator, type));
}
if (DictionaryFieldHandler.IsCompatibleWith(type))
{
return(new DictionaryFieldHandler(_provider.FieldHandlerFactory, _provider.TypeConvertorGenerator, type));
}
if (NullableFieldHandler.IsCompatibleWith(type))
{
return(new NullableFieldHandler(_provider.FieldHandlerFactory, _provider.TypeConvertorGenerator, type));
}
return(null);
}