public MetaFormatter(Type formatterType)
{
var formatterAttribute = formatterType.GetCustomAttribute<FormatterAttribute>();
if (!IsFormatterType(formatterType))
throw new ArgumentException("Type should be a formatter type, i.e. a subclass of Formatter with FormatterAttribute", "type");
this.FormatterType = formatterType;
this.FormatterAttribute = formatterAttribute;
this.GrammarType = formatterAttribute.GrammarType;
}