### Question:
CodeGenerator { public static void generateDaoGetMethod(boolean isReturnList, String beanNameRegex, String tableName, String attrs) throws IOException, TemplateException { File dir = resourceLoader.getResource("classpath:/tmpl/code").getFile(); Bean bean = new Bean(); bean.setTableName(tableName); String[] attrArray = attrs.replace(", ", ",").split(","); for (String attr : attrArray) { try { String[] splits = attr.split(" "); Property property = new Property(); property.setType(new PropertyType(splits[0])); property.setName(splits[1]); bean.addProperty(property); } catch (Exception e) { throw new RuntimeException("attr的格式应为$Javatype$ $attrName$"); } } Configuration cfg = new Configuration(); cfg.setDirectoryForTemplateLoading(dir); cfg.setObjectWrapper(new DefaultObjectWrapper()); Template temp = cfg.getTemplate(isReturnList ? "daoGetForListMethodTmpl.ftl" : "daoGetForObjMethodTmpl.ftl"); Map dataMap = new HashMap(); dataMap.put("bean", bean); if (beanNameRegex != null) { Pattern pattern = Pattern.compile(beanNameRegex); Matcher matcher = pattern.matcher(bean.getTableName()); matcher.find(); String group = matcher.group(matcher.groupCount()); bean.setName(StringUtils.uncapitalizeCamelBySeparator(group, "_")); } Writer out = new OutputStreamWriter(System.out); temp.process(dataMap, out); out.flush(); out.close(); }  static void generateSetter(File file, String className); static void generateDaoGetMethod(boolean isReturnList, String beanNameRegex, String tableName, String attrs);  }### Answer:
@Test public void generateDAOGetMethod() throws Exception { CodeGenerator.generateDaoGetMethod(false, "^YEB_(\\w+)$", "ER_FUND_PRODUCTS", "String thirdCompanyCode"); }