initflow.java
来自「一个工作流组件(包括定义和引擎)」· Java 代码 · 共 83 行
JAVA
83 行
package org.shaoye.workflow.flow;
import java.io.*;
import org.panda.*;
import org.jdom.input.SAXBuilder;
import org.jdom.Document;
import org.jdom.Element;
import java.io.StringReader;
/**
*
* <p>Title: 初始化工作流 </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class InitFlow {
private static Document doc = null;
private static Element root = null;
public InitFlow() {}
/**
* 生成 XML DOC 文件
* @param _file String
* @return Document
* @throws FileNotFoundException
* @throws Exception
*/
public static Element getRootXML()
throws FileNotFoundException, Exception
{
InputStream is = null;
SAXBuilder builder = null;
try
{
builder = new SAXBuilder();
is = new FileInputStream( Globals.XML_PATH_NAME );
//byte[] _byte= new Byte[is.available()];
//is.read(_byte);
Document doc = builder.build(is);
root = doc.getRootElement();
}
catch(FileNotFoundException fex)
{
throw fex;
}
catch(Exception ex)
{
throw ex;
}
finally
{
if(is!=null)
is.close();
return root;
}
}
public Document getDoc() {
return doc;
}
public void setDoc(Document doc) {
this.doc = doc;
}
public void setRoot(Element root) {
this.root = root;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?