code: public void generateClass(TreeLogger logger, GeneratorContext context, List<JClassType> subclasses) {
  
          PrintWriter printWriter = context.tryCreate(logger, PACKAGE_NAME, CLASS_NAME);
          if (printWriter == null) {
              return;
          }
          ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(PACKAGE_NAME, CLASS_NAME);
          composer.addImplementedInterface(INIT_INTERFACE_NAME);
          SourceWriter sourceWriter = composer.createSourceWriter(context, printWriter);
          sourceWriter.println("public java.util.Map<String, " + COMMAND_INTERFACE + "> initCommands() {");
          sourceWriter.indent();
          sourceWriter.println(
              "java.util.Map<String, "
                  + COMMAND_INTERFACE
                  + "> result=new java.util.HashMap<String, "
                  + COMMAND_INTERFACE
                  + ">();");
          for (JClassType type : subclasses) {
              sourceWriter.println(
                  "result.put(\""
                      + type.getQualifiedSourceName()
                      + "\","
                      + type.getQualifiedSourceName()
                      + "."
                      + GET_COMMAND_METHOD
                      + "());");
          }
          sourceWriter.println("return result;");
          sourceWriter.outdent();
          sourceWriter.println("}");
          sourceWriter.outdent();
          sourceWriter.println("}");
          context.commit(logger, printWriter);
      }
docs: This method generates the source code for the class initializer class.<p>
  
  @param logger the logger to be used
  @param context the generator context
  @param subclasses the classes for which the generated code should the initClass() method