📄 initflow.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -