Examples of CodeGenerator


Examples of com.alexkasko.springjdbc.typedqueries.codegen.CodeGenerator

            if(null != updateRegex) builder.setUpdateRegex(updateRegex);
            if(null != templateRegex) builder.setTemplateRegex(templateRegex);
            if(null != templateValueConstraintRegex) builder.setTemplateValueConstraintRegex(templateValueConstraintRegex);
            if(null != typeIdMapJson) builder.setTypeIdMap(parseTypeIdMap(typeIdMapJson));
            if(null != templateFile) builder.setFreemarkerTemplate(FileUtils.readFileToString(templateFile, templateFileEncoding));
            CodeGenerator cg = builder.build();
            CountingOutputStream counter = new CountingOutputStream(openOutputStream(outFile));
            outWriter = new OutputStreamWriter(counter, "UTF-8");
            getLog().info("Generating queries wrapper for file: [" + queriesFile.getAbsolutePath() + "] " +
                    "into java file: [" + outFile.getAbsolutePath() + "]");
            cg.generate(queries, fcn, queriesFile.getName(), outWriter);
            getLog().info("Writing compete, bytes written: [" + counter.getCount() + "]");
        } catch(IOException e) {
            throw new MojoFailureException("IO error", e);
        } catch (ClassNotFoundException e) {
            throw new MojoFailureException("Type id map error", e);
View Full Code Here

Examples of com.cedarsoft.codegen.CodeGenerator

      T decisionCallback = createDecisionCallback();

      //The Serializer
      if ( configuration.getCreationMode().isCreate() ) {
        configuration.getLogOut().println( "Generating Serializer:" );
        CodeGenerator codeGenerator = new CodeGenerator( decisionCallback );
        instantiateGenerator( codeGenerator ).generateSerializer( descriptor );
        codeGenerator.getModel().build( configuration.getDestination(), configuration.getResourcesDestination(), statusPrinter );
      }

      //The Serializer Tests
      if ( configuration.getCreationMode().isCreateTests() ) {
        CodeGenerator testCodeGenerator = new CodeGenerator( decisionCallback );

        configuration.getLogOut().println( "Generating Serializer Tests:" );
        String serializerClassName = AbstractGenerator.createSerializerClassName( descriptor.getQualifiedName() );
        instantiateTestGenerator( testCodeGenerator ).generateSerializerTest( serializerClassName, descriptor );
        instantiateTestGenerator( testCodeGenerator ).generateSerializerVersionTest( serializerClassName, descriptor );

        testCodeGenerator.getModel().build( configuration.getTestDestination(), configuration.getTestResourcesDestination(), statusPrinter );
      }
    }
View Full Code Here

Examples of com.google.code.apis.rest.client.CodeGeneration.CodeGenerator

                }
              }           
            break;
          }
        }
        CodeGenerator codeGenerator = new CodeGenerator(Analyzer.application);
        String code = codeGenerator.generate(CodeGenerator.dogfood_php5);       
        new XmlHttpRequest(code, SettingsDialog.pathToDiscoverer);       
      }
    });
    autoDiscoverPanel.add(autoDiscoverButton);
    applicationPanel.add(autoDiscoverPanel);
View Full Code Here

Examples of com.google.code.apis.rest.client.CodeGeneration.CodeGenerator

  /**
   * @param language
   */
  protected static void generateCode(String language) {
    CodeGenerator codeGenerator = new CodeGenerator(Analyzer.application);   
    buttonPanel.setVisible(true);
    compilePanel.setVisible(true);   
    listParams();   
    toggleNamingPanels(SettingsDialog.useEndpointAsName);
    String code = codeGenerator.generate(language);
    codeTextArea.setText(code);
    listUsedClassNames();
  }
View Full Code Here

Examples of com.google.gxp.compiler.codegen.CodeGenerator

   * specified {@code OutputLanguage}.
   */
  void execute(AlertSink alertSink, AlertPolicy alertPolicy) {
    SourcePosition outputPosition = new SourcePosition(outputFileRef);
    alertSink.add(new ProgressAlert(outputPosition, "Generating"));
    CodeGenerator codeGenerator =
        codeGeneratorFactory.getCodeGenerator(language, compilationUnit);

    AlertCounter counter = new AlertCounter(alertSink, alertPolicy);

    StringBuilder sb = new StringBuilder();
    try {
      codeGenerator.generateCode(sb, counter);

      if (counter.getErrorCount() == 0) {
        Writer writer = outputFileRef.openWriter(Charsets.US_ASCII);
        try {
          writer.write(sb.toString());
View Full Code Here

Examples of com.googlecode.aviator.code.CodeGenerator

    }


    private static Expression innerCompile(final String expression) {
        ExpressionLexer lexer = new ExpressionLexer(expression);
        CodeGenerator codeGenerator = newCodeGenerator();
        ExpressionParser parser = new ExpressionParser(lexer, codeGenerator);
        return parser.parse();
    }
View Full Code Here

Examples of com.strobel.reflection.emit.CodeGenerator

        _constructorBuilder = typeBuilder.defineConstructor(
            Modifier.PUBLIC,
            Type.list(closureType)
        );

        final CodeGenerator ctor = _constructorBuilder.getCodeGenerator();

        ctor.emitThis();
        ctor.call(Types.Object.getConstructors().get(0));
        ctor.emitThis();
        ctor.emitLoadArgument(0);
        ctor.putField(_closureField);
        ctor.emitReturn();
    }
View Full Code Here

Examples of generator.CodeGenerator

   
    LexiconAnalyzer lexicon = new LexiconAnalyzer( "codigo.tny" );
    SyntacticAnalyzer syntactic = new SyntacticAnalyzer( lexicon.analyze() );
    SyntaxTree tree = syntactic.analyze();
    TableBuilder builder = new TableBuilder( tree );
    CodeGenerator generator = new CodeGenerator( tree, builder.build() );
   
    generator.generate( "codigo.tm" );
  }
View Full Code Here

Examples of net.jangaroo.jooc.CodeGenerator

      functionExpr.getBody().visit(this);
    }
  }

  public CodeGenerator getParameterInitializerCodeGenerator(final Parameters params) {
    return new CodeGenerator() {
      @Override
      public void generate(JsWriter out, boolean first) throws IOException {
        // collect the ... (rest) parameter and all optional parameters with their position index:
        int restParamIndex = -1;
        Parameter restParam = null;
View Full Code Here

Examples of org.antlr.codegen.CodeGenerator

            adjustedColumn = getDecisionColumn(g = engine.getDiscoveredLexerGrammar());

        if(adjustedColumn == -1)
            throw new Exception("No decision in the current line");

        CodeGenerator generator = new CodeGenerator(new Tool(), g,
                (String) g.getOption("language"));

        DFA dfa = g.getLookaheadDFAFromPositionInFile(line, adjustedColumn);
        decisionNumber = dfa.getDecisionNumber();
        DOTGenerator dg = new DOTGenerator(g);
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.