/**
  * @param srcWriter
  * @param className
  */
 private void generateFieldsPopulationCallback(SourcePrinter srcWriter, JClassType type) {
   String className = type.getQualifiedSourceName();
   srcWriter.println("new IocScope.CreateCallback<" + className + ">(){");
   srcWriter.println("public void onCreate(" + className + " newObject){");
   injectFieldsAndMethods(
       srcWriter,
       type,
       "newObject",
       new HashSet<String>(),
       getProxySimpleName() + ".this",
       configurations);
   srcWriter.println("}");
   srcWriter.println("}");
 }
 /** @param srcWriter */
 protected void createController(SourcePrinter srcWriter, String viewVariable) {
   String genClass = new ControllerProxyCreator(logger, context, controllerClass).create();
   srcWriter.println("this._controller = new " + genClass + "(" + viewVariable + ");");
   srcWriter.println(
       "(("
           + DeviceAdaptiveController.class.getCanonicalName()
           + ")this._controller).setBoundWidget(this);");
   IocContainerRebind.injectFieldsAndMethods(
       srcWriter,
       controllerClass,
       "this._controller",
       viewVariable + ".getTypedIocContainer()",
       view,
       device);
 }
 /**
  * @param srcWriter
  * @param type
  * @param parentVariable
  * @param iocContainerVariable
  * @param view
  * @param device
  */
 public void injectFieldsAndMethods(
     SourcePrinter srcWriter,
     JClassType type,
     String parentVariable,
     String iocContainerVariable,
     View view,
     Device device) {
   Map<String, IocConfig<?>> configurations =
       iocContainerManager.getConfigurationsForView(view, device);
   injectFieldsAndMethods(
       srcWriter,
       type,
       parentVariable,
       new HashSet<String>(),
       iocContainerVariable,
       configurations);
 }
 /**
  * @param srcWriter
  * @param type
  * @param parentVariable
  * @param added
  * @param iocContainerVariable
  * @param configurations
  */
 private static void injectFieldsAndMethods(
     SourcePrinter srcWriter,
     JClassType type,
     String parentVariable,
     Set<String> added,
     String iocContainerVariable,
     Map<String, IocConfig<?>> configurations) {
   injectFields(srcWriter, type, parentVariable, added, iocContainerVariable, configurations);
   injectMethods(srcWriter, type, parentVariable, added, iocContainerVariable, configurations);
   if (type.getSuperclass() != null) {
     injectFieldsAndMethods(
         srcWriter,
         type.getSuperclass(),
         parentVariable,
         added,
         iocContainerVariable,
         configurations);
   }
 }