class JavaGeneratorCrd2JavaTask extends DefaultTask {

  private final JavaGeneratorPluginExtension extensionClass;

  public static final String NAME = "crd2java";

  @Inject
  public JavaGeneratorCrd2JavaTask(Class<? extends JavaGeneratorPluginExtension> extensionClass) {
    this.extensionClass = getProject().getExtensions().getByType(extensionClass);
    setDescription("Generate Java model from CRDs.");
  }

  @TaskAction
  public final void runTask() {<FILL_FUNCTION_BODY>}
}


    final Config config = extensionClass.getConfig();

    List<JavaGenerator> runners = new ArrayList<>();

    final List<String> urls = extensionClass.getUrlsOrDefault();
    if (urls != null && !urls.isEmpty()) {
      final List<URL> urlList = new ArrayList<>();
      for (String url : urls) {
        try {
          urlList.add(new URL(url));
        } catch (MalformedURLException e) {
          throw new GradleException("URL '" + url + "' is not valid", e);
        }
      }
      final File downloadTarget = extensionClass.getDownloadTargetOrDefault();
      if (!downloadTarget.isDirectory()) {
        downloadTarget.mkdirs();
      }
      runners.add(new URLJavaGenerator(config, urlList, downloadTarget));
    }
    final File source = extensionClass.getSourceOrDefault();
    if (source != null) {
      runners.add(new FileJavaGenerator(config, source));
    }

    if (runners.isEmpty()) {
      throw new GradleException("No source or urls specified");
    }

    runners.forEach(r -> r.run(extensionClass.getTargetOrDefault()));
  
<no_super_class>