Package cn.org.rapid_framework.generator

Examples of cn.org.rapid_framework.generator.GeneratorFacade$PrintUtils


    List list = new ArrayList();
    list.add("mybatis_user_info.xml");
    list.add("user_info.xml");
   
    TableConfigSet tableConfigSet = new TableConfigXmlBuilder().parseFromXML(basedir,"com.company.test", list);
    GeneratorFacade gf = new GeneratorFacade();
    Map map = new HashMap();
    map.put("tableConfigSet", tableConfigSet);
    map.put("tableConfigs", tableConfigSet.getTableConfigs());
    map.put("basepackage", "com.company.project");
    map.put("sequencesList", "list,list");
    map.put("StringHelper", new StringHelper());
   
    gf.getGenerator().addTemplateRootDir(FileHelper.getFileByClassLoader("for_generate_by_table_config_set"));
    gf.generateByMap(map);
  }
View Full Code Here


   
    public void test_get_includeSqlParams() throws Exception {
      hashMap.put("user-Info.where", "username = #username# and password = #password# and age = #age# ");
      parser.parse("select * from user_info where <include refid='user-Info.where'/>",hashMap);
     
      GeneratorFacade gf = new GeneratorFacade();
      gf.getGenerator().setTemplateRootDir("classpath:for_test_sql_segment");
      for(SqlSegment segment : parser.usedIncludedSqls.values()) {
        segment.setParams(segment.getParams(new SqlFactory().parseSql(parser.resultSql)));
        Map map = new HashMap();
        map.put("sqlSegment", segment);
        map.putAll(BeanHelper.describe(segment));
View Full Code Here

      }
    }
  }

  private static void processLine(Scanner sc) throws Exception {
    GeneratorFacade facade = new GeneratorFacade();
    String cmd = sc.next();
    if("gen".equals(cmd)) {
      String[] args = nextArguments(sc);
      if(args.length == 0) return;
      facade.getGenerator().setIncludes(getIncludes(args,1));
      facade.getGenerator().addTemplateRootDir(new File(getTemplateRootDir()));
      facade.generateByTable(args[0]);
      if(SystemHelper.isWindowsOS) {
          Runtime.getRuntime().exec("cmd.exe /c start "+GeneratorProperties.getRequiredProperty("outRoot").replace('/', '\\'));
      }
    }else if("del".equals(cmd)) {
      String[] args = nextArguments(sc);
      if(args.length == 0) return;
      facade.getGenerator().setIncludes(getIncludes(args,1));
      facade.getGenerator().addTemplateRootDir(new File(getTemplateRootDir()));
      facade.deleteByTable(args[0]);
    }else if("quit".equals(cmd)) {
        System.exit(0);
    }else {
      System.err.println(" [ERROR] unknow command:"+cmd);
    }
View Full Code Here

        GeneratorProperties.setProperties(new Properties());
        Properties properties = toProperties(getProject().getProperties());
        properties.setProperty("basedir", getProject().getBaseDir().getAbsolutePath());
        GeneratorProperties.setProperties(properties);
       
        GeneratorFacade gf = new GeneratorFacade();
        gf.getGenerator().addTemplateRootDir(input);
        if(shareInput != null) {
            gf.getGenerator().addTemplateRootDir(shareInput);
        }
        gf.getGenerator().setOutRootDir(output);
        return gf;
    }
View Full Code Here

    protected void executeInternal() throws Exception {
        freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
       
        executeBefore();
       
        GeneratorFacade facade = createGeneratorFacade(input,output);
       
        List<Map> maps = getGeneratorContexts();
        if(maps == null) return;
        for(Map map : maps) {
            facade.generateByMap(map);
        }
       
        if(openOutputDir && SystemHelper.isWindowsOS) {
            Runtime.getRuntime().exec("cmd.exe /c start "+output);
        }
View Full Code Here

      }
    }
  }

  private static void processLine(Scanner sc) throws Exception {
    GeneratorFacade facade = new GeneratorFacade();
    String cmd = sc.next();
    if("gen".equals(cmd)) {
      String[] args = nextArguments(sc);
      if(args.length == 0) return;
      facade.g.setIncludes(getIncludes(args,1));
      facade.generateByTable(args[0],getTemplateRootDir());
      if(SystemHelper.isWindowsOS) {
          Runtime.getRuntime().exec("cmd.exe /c start "+GeneratorProperties.getRequiredProperty("outRoot").replace('/', '\\'));
      }
    }else if("del".equals(cmd)) {
      String[] args = nextArguments(sc);
      if(args.length == 0) return;
      facade.g.setIncludes(getIncludes(args,1));
      facade.deleteByTable(args[0], getTemplateRootDir());
    }else if("quit".equals(cmd)) {
        System.exit(0);
    }else {
      System.err.println(" [ERROR] unknow command:"+cmd);
    }
View Full Code Here

TOP

Related Classes of cn.org.rapid_framework.generator.GeneratorFacade$PrintUtils

Copyright © 2018 www.massapicom. 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.