📄 strutsgenrunner.java
字号:
package com.sutternow.swingkar.util;import com.javanovic.karapansapi.xml.XMLHandler;import com.javanovic.karapansapi.xml.XMLHandlerImpl;import com.javanovic.karapansapi.xml.Strutscreator;import com.javanovic.karapansapi.xml.XMLException;import com.javanovic.karapansapi.strutsgen.StrutsGenerator;import java.util.ResourceBundle;import java.util.PropertyResourceBundle;import java.io.FileNotFoundException;/** * Created by IntelliJ IDEA. * User: sergei * Date: May 4, 2003 * Time: 1:25:12 AM * To change this template use Options | File Templates. */public class StrutsGenRunner { protected final static String TEMPLATE_DIR = "template/"; protected final static String LAYOUT_DIR = "layout"; protected final static String XSLT_FILE = "xslt/html.xsl"; public void doGeneration(String srcFileName) { long start = System.currentTimeMillis(); XMLHandler handler = new XMLHandlerImpl(); Strutscreator app = null; try { app = handler.load(srcFileName); } catch (FileNotFoundException e) { e.printStackTrace(); //To change body of catch statement use Options | File Templates. } catch (XMLException e) { e.printStackTrace(); //To change body of catch statement use Options | File Templates. } StrutsGenerator gen = StrutsGenerator.createStrutsGenerator(); ResourceBundle prop = PropertyResourceBundle.getBundle("com.javanovic.karapansapi.strutsgen.strutsgen"); gen.setLayoutDir("bin/" + prop.getString("layout.dir")); gen.setTemplateDir(prop.getString("template.dir")); //"e:/java/prjsource/strutsgenerator/bin/template" gen.setXsltFile("bin/" + prop.getString("xslt.file")); try { gen.generateFiles(app); } catch (Exception e) { e.printStackTrace(); //To change body of catch statement use Options | File Templates. } long end = System.currentTimeMillis(); System.out.print((double) (end - start) / 1000); System.out.println(" seconds"); java.text.DecimalFormat f = new java.text.DecimalFormat("#,###"); System.out.println( f.format(gen.getGeneratedByteCount() / 1024) + " KB generated"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -