<commit_before>import 'dart:async';

import 'package:source_gen/source_gen.dart';
import 'package:build/build.dart';

import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';

import 'package:corona/src/builder/template/declaration.dart';
import 'package:corona/src/builder/template/schema.dart';

class ClassGenerator extends Generator {

  const ClassGenerator();

  @override
  Future<String> generate(Element element, _) async {
    if (element is ClassElement && element.isAbstract) {
      final StringBuffer buffer = new StringBuffer();
      const DeclarationDecoder<ClassElement, String> decl = const DeclarationDecoder<ClassElement, String>();
      const SchemaDecoder<ClassElement, String> schema = const SchemaDecoder<ClassElement, String>();

      buffer.write(decl.convert(element));
      buffer.write(schema.convert(element));

      return buffer.toString();
    }

    return null;
  }

}<commit_msg>no message<commit_after>import 'dart:async';

import 'package:source_gen/source_gen.dart';
import 'package:build/build.dart';

import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';

import 'package:corona/src/builder/template/declaration.dart';
import 'package:corona/src/builder/template/schema.dart';

class ClassGenerator extends Generator {

  const ClassGenerator();

  @override
  FutureOr<String> generate(LibraryReader library, _) async {
    library.allElements.forEach((Element element) {
      if (element is ClassElement && element.isAbstract) {
        final StringBuffer buffer = new StringBuffer();
        const DeclarationDecoder<ClassElement, String> decl = const DeclarationDecoder<ClassElement, String>();
        const SchemaDecoder<ClassElement, String> schema = const SchemaDecoder<ClassElement, String>();

        buffer.write(decl.convert(element));
        buffer.write(schema.convert(element));

        return buffer.toString();
      }
    });

    return null;
  }

}
{'fraction_non_alphanumeric': 0.11972180824639841, 'fraction_numerical': 0.0, 'mean_word_length': 4.7542857142857144, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4537091', 'n_tokens_mistral': 574, 'n_tokens_neox': 558, 'n_words': 113}