getConvert method

Convert? getConvert(
  1. Type sourceType
)

Implementation

Convert? getConvert(Type sourceType) {
  for ( Convert convert in converters)
    if ( convert.sourceType == sourceType )
      return convert ;

  for ( ConvertFactory factory in factories)
    if ( factory.accepts(sourceType)) {
      var convert = factory.getConvert(sourceType);

      converters.add(convert);

      return convert;
    }

  return null;
}