在Eclipse 里用velocity模板来生成文件.docVIP

  • 25
  • 0
  • 约7千字
  • 约 7页
  • 2017-02-28 发布于湖北
  • 举报
Eclipse 插件开发,用velocity生成文件 在Eclipse 里用velocity模板来生成文件,原来这么简单. IFile file = root.getFile(new Path(path.getTarget())); path.setEncoding(file.getCharset()); monitor.setTaskName(file.getProjectRelativePath().toOSString()); if (file.exists()) { } ByteArrayOutputStream bos = CodeGenActivator.getDefault() .getTemplateStream(selectInfo, path, mtables, this.mpage.getModuleDir()); { byte[] data = bos.toByteArray(); // 这里应该有一个选项,是不是要覆盖掉原来的旧文件. if (file.exists()) { file.setContents(new ByteArrayInputStream(data), true, true, monitor)

文档评论(0)

1亿VIP精品文档

相关文档