Which Factory Is It

abstract class ExportJob {
    protected abstract Writer newWriter(OutputStream out);

    public final void run(Query q, OutputStream out) {
        Writer w = newWriter(out);
        w.header(q.columns());
        for (Row r : q.rows()) w.row(r);
        w.close();
    }
}

final class CsvExportJob extends ExportJob {
    protected Writer newWriter(OutputStream out) { return new CsvWriter(out); }
}

final class ParquetExportJob extends ExportJob {
    protected Writer newWriter(OutputStream out) { return new ParquetWriter(out); }
}

Which creational pattern is this, and what would have to change for it to become the other one it is usually confused with?

A

Prototype. Each subclass hands the framework a preconfigured Writer that gets copied for every export.

B

Factory Method. It becomes Abstract Factory when ExportJob stops subclassing and instead holds a separate factory object that produces a whole related family: a Writer plus the matching Compressor plus the matching SchemaEncoder.

C

Abstract Factory already. newWriter is an abstract manufacturing method and CsvExportJob is a concrete factory, which is the definition.

D

Builder. run assembles the output in ordered steps (header, then rows, then close), and the subclasses supply the parts, which is step-by-step construction of a product.