if (out != null) {
// There is actual work to do
doCreateBundleForPermutation(logger, generatorContext, fields,
generatedSimpleSourceName);
// Begin writing the generated source.
ClassSourceFileComposerFactory f = new ClassSourceFileComposerFactory(
packageName, generatedSimpleSourceName);
// The generated class needs to be able to determine the module base URL
f.addImport(GWT.class.getName());
// Used by the map methods
f.addImport(ResourcePrototype.class.getName());
// The whole point of this exercise
f.addImplementedInterface(sourceType.getQualifiedSourceName());
// All source gets written through this Writer
SourceWriter sw = f.createSourceWriter(generatorContext, out);
// Set the now-calculated simple source name
resourceContext.setSimpleSourceName(generatedSimpleSourceName);
// Write the generated code to disk