Examples of ClassSourceFileComposerFactory


Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

  private int nextId () {
    return nextId++;
  }

  public String create () {
    ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(packageName, simpleName);
    composer.addImplementedInterface("com.artemis.gwtref.client.IReflectionCache");
    imports(composer);
    PrintWriter printWriter = context.tryCreate(logger, packageName, simpleName);
    if (printWriter == null) {
      return packageName + "." + simpleName;
    }
    sw = composer.createSourceWriter(context, printWriter);

    generateLookups();

    getKnownTypesC();
    forNameC();
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    createProxy(type);
    return packageName + "." + simpleName;
  }

  private void createProxy (JClassType type) {
    ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(type.getPackage().getName(),
      type.getSimpleSourceName() + "Proxy");
    PrintWriter printWriter = context.tryCreate(logger, packageName, simpleName);
    if (printWriter == null) {
      return;
    }
    SourceWriter writer = composer.createSourceWriter(context, printWriter);
    writer.commit(logger);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

        String gennedTypeName = getClassName(requestedTypeName) + gennedTypeNameSuffix;
        PrintWriter pw = context.tryCreate(logger, packageName, gennedTypeName);
      
        // No PrintWriter means we've generated the same code before.
        if (pw != null) {
            factory = new ClassSourceFileComposerFactory(packageName, gennedTypeName);
            classGenerator.classSetup();
            sw = factory.createSourceWriter(context, pw);                       
            classGenerator.generateClass();
            sw.commit(logger);
        }
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

        }

        String implTypeName = objectType.getSimpleSourceName() + "Impl";
        String implPackageName = objectType.getPackage().getName();

        ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(
                implPackageName, implTypeName );

        composerFactory.addImport( Map.class.getCanonicalName() );
        composerFactory.addImport( List.class.getCanonicalName() );
        composerFactory.addImport( Constants.class.getCanonicalName() );
        composerFactory.addImport( Images.class.getCanonicalName() );
        composerFactory.addImport( ImageResource.class.getCanonicalName() );
        composerFactory.addImport( RuleAsset.class.getCanonicalName() );
        composerFactory.addImport( RuleViewer.class.getCanonicalName() );
        composerFactory.addImport( DefaultContentUploadEditor.class.getCanonicalName() );
        composerFactory.addImport( Widget.class.getCanonicalName() );
        composerFactory.addImport( GWT.class.getCanonicalName() );
        composerFactory.addImport( ClientFactory.class.getCanonicalName() );
        composerFactory.addImplementedInterface( objectType
                .getQualifiedSourceName() );

        PrintWriter printWriter = context.tryCreate( logger, implPackageName,
                implTypeName );
        if ( printWriter != null ) {
            SourceWriter sourceWriter = composerFactory.createSourceWriter(
                    context, printWriter );

            List<AssetEditorConfiguration> registeredEditors = loadAssetEditorMetaData();
            generateAttributes( sourceWriter );
            generateGetRegisteredAssetEditorFormatsMethod( sourceWriter, registeredEditors );
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    if (printWriter == null)
    {
      return null;
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(
        packageName, className);

    composerFactory.addImport(Screen.class.getName());
    composerFactory.addImport(Map.class.getName());
    composerFactory.addImport(HashMap.class.getName());
    composerFactory.addImport(AsyncCallback.class.getName());
    if (this.hasSyncTokenMethod)
    {
      composerFactory.addImport(CruxSynchronizerTokenService.class.getName());
      composerFactory.addImport(CruxSynchronizerTokenServiceAsync.class.getName());
      composerFactory.addImport(GWT.class.getName());
    }
   
    composerFactory.setSuperclass(asyncServiceName);
    return composerFactory.createSourceWriter(ctx, printWriter);
 
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    if (printWriter == null)
    {
      return null;
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, getProxySimpleName());

    String[] imports = getImports();
    for (String imp : imports)
    {
      composerFactory.addImport(imp);
    }

    return new SourcePrinter(composerFactory.createSourceWriter(context, printWriter), logger);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    if (printWriter == null)
    {
      return null;
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, getProxySimpleName());

    String[] imports = getImports();
    for (String imp : imports)
    {
      composerFactory.addImport(imp);
    }

    composerFactory.addImplementedInterface(baseIntf.getQualifiedSourceName());

    return new SourcePrinter(composerFactory.createSourceWriter(context, printWriter), logger);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    if (pw == null) {
      return packageName + "." + simpleSourceName;
    }

    // start making the class, with basic imports
    ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory(packageName, simpleSourceName);
    factory.addImplementedInterface(typeName);
    SourceWriter sw = factory.createSourceWriter(context, pw);


    // for each method,
    for (JMethod m : toGenerate.getOverridableMethods()) {
      TreeLogger l = logger.branch(Type.DEBUG, "Building method: " + m.getReadableDeclaration());

      // no support for params at this time
      if (m.getParameters().length != 0) {
        l.log(Type.ERROR, "Method " + m.toString() + " must not have parameters.");
        throw new UnableToCompleteException();
      }

      // ask for the types that provide the property data
      JClassType ret = m.getReturnType().isClassOrInterface();
      final AbstractCreator c;
      if (ret.isAssignableTo(valueProviderInterface)) {
        c = new ValueProviderCreator(context, l, m);
      } else if (ret.isAssignableTo(modelKeyProviderInterface)) {
        c = new ModelKeyProviderCreator(context, l, m);
      } else if (ret.isAssignableTo(labelProviderInterface)) {
        c = new LabelProviderCreator(context, l, m);
      } else {
        logger.log(Type.ERROR, "Method uses a return type that cannot be generated");
        throw new UnableToCompleteException();
      }
      c.create();
      // build the method
      // public ValueProvider<T, V> name() { return NameValueProvider.instance;
      // }
      sw.println("public %1$s %2$s() {", m.getReturnType().getQualifiedSourceName(), m.getName());
      sw.indentln("return %1$s;", c.getInstanceExpression());
      sw.println("}");
    }

    sw.commit(logger);

    return factory.getCreatedClassName();
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    if (printWriter == null)
    {
      return null;
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, getProxySimpleName());

    String[] imports = getImports();
    for (String imp : imports)
    {
      composerFactory.addImport(imp);
    }

    composerFactory.setSuperclass(dataSourceClass.getParameterizedQualifiedSourceName());
    composerFactory.addImplementedInterface(ViewAware.class.getCanonicalName());

    return new SourcePrinter(composerFactory.createSourceWriter(context, printWriter), logger);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory

    if (printWriter == null)
    {
      return null;
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, getProxySimpleName());

    String[] imports = getImports();
    for (String imp : imports)
    {
      composerFactory.addImport(imp);
    }
    composerFactory.setSuperclass("WSQLCursor<"+getKeyTypeName()+","+getKeyTypeName(objectStoreKeyPath)+","+getKeyTypeName(objectStoreKeyPath)+">");

    return new SourcePrinter(composerFactory.createSourceWriter(context, printWriter), logger);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.