首页>代码>java读取WORD/EXCEL模板转换生成新WORD/EXCEL文档>/office/src/main/java/me/jtx/office/impl/WordOfficeDocumentImpl.java
package me.jtx.office.impl; import java.util.Map; import me.jtx.office.WordOfficeDocument; import me.jtx.office.util.WordUtil; /** * @author JSTHZX * */ public class WordOfficeDocumentImpl implements WordOfficeDocument { WordUtil wordUtil=new WordUtil(); public boolean generateDocument(String templateFileName, String destFileName, Map<String, Object> map) { String filetype = templateFileName.substring(templateFileName.lastIndexOf(".") + 1); if(filetype.equalsIgnoreCase("doc")) return wordUtil.generateBIFF8Document(templateFileName, destFileName, map); else if(filetype.equalsIgnoreCase("docx")){ return wordUtil.generateOOXMLDocument(templateFileName, destFileName, map); }else{ return false; } } }