code: Iterable<ClassData> compile() {
      List<ClassData> classes = new ArrayList<>();
  
      // first generate the factory
      if (templateNode.getVisibility() != Visibility.PRIVATE) {
        // Don't generate factory if the template is private.  The factories are only
        // useful to instantiate templates for calls from java.  Soy->Soy calls should invoke
        // constructors directly.
        new TemplateFactoryCompiler(template, templateNode, innerClasses).compile();
      }
  
      writer =
          SoyClassWriter.builder(template.typeInfo())
              .setAccess(Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER + Opcodes.ACC_FINAL)
              .implementing(TEMPLATE_TYPE)
              .sourceFileName(templateNode.getSourceLocation().getFileName())
              .build();
      generateTemplateMetadata();
      generateKindMethod();
      stateField.defineField(writer);
      paramsField.defineField(writer);
      ijField.defineField(writer);
      for (FieldRef field : paramFields.values()) {
        field.defineField(writer);
      }
  
      ImmutableMap<TemplateParam, SoyExpression> defaultParamInitializers = generateRenderMethod();
  
      generateConstructor(defaultParamInitializers);
  
      innerClasses.registerAllInnerClasses(writer);
      writer.visitEnd();
  
      classes.add(writer.toClassData());
      classes.addAll(innerClasses.getInnerClassData());
      writer = null;
      return classes;
    }
docs: Returns the list of classes needed to implement this template.
  
  <p>For each template, we generate:
  
  <ul>
  <li>A {@link com.google.template.soy.jbcsrc.shared.CompiledTemplate.Factory}
  <li>A {@link CompiledTemplate}
  <li>A DetachableSoyValueProvider subclass for each {@link LetValueNode} and {@link
  CallParamValueNode}
  <li>A DetachableContentProvider subclass for each {@link LetContentNode} and {@link
  CallParamContentNode}
  <p>Note: This will <em>not</em> generate classes for other templates, only the template
  configured in the constructor. But it will generate classes that <em>reference</em> the
  classes that are generated for other templates. It is the callers responsibility to
  ensure that all referenced templates are generated and available in the classloader that
  ultimately loads the returned classes.