當前位置: 首頁>>代碼示例>>Java>>正文


Java DocumentException.printStackTrace方法代碼示例

本文整理匯總了Java中org.dom4j.DocumentException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java DocumentException.printStackTrace方法的具體用法?Java DocumentException.printStackTrace怎麽用?Java DocumentException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.dom4j.DocumentException的用法示例。


在下文中一共展示了DocumentException.printStackTrace方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: XMLBeanFactory

import org.dom4j.DocumentException; //導入方法依賴的package包/類
public XMLBeanFactory(InputStream input) {
    SAXReader reader = new SAXReader();
    Document doc = null;
    try {
        doc = reader.read(input);
        if (doc == null)
            return;
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    Element root = doc.getRootElement();
            
    @SuppressWarnings("unchecked")
    List<Element> beanElems = root.elements();
    for (Element beanElem : beanElems) {
        Bean bean = parseBeanElement(beanElem);

        addBean(bean);
    }
    
    instancetiateSingletons();
}
 
開發者ID:hulang1024,項目名稱:SummerFramework,代碼行數:23,代碼來源:XMLBeanFactory.java

示例2: testdeployDefinition

import org.dom4j.DocumentException; //導入方法依賴的package包/類
@Test
public void testdeployDefinition() {
    // 初始化

    SAXReader reader = new SAXReader();
    // 拿不到信息
    //URL url = this.getClass().getResource("/multipleTask.xml");
    URL url = this.getClass().getResource("/singleTask.xml");
    Document document = null;
    try {
        document = reader.read(url);
    } catch (DocumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    String definitionContent = document.asXML();
    // deploy first time
    DefinitionHelper.getInstance().deployDefinition("singleTask", "測試單人任務流程", definitionContent, true);
    //DefinitionHelper.getInstance().deployDefinition("multipleTask", "測試多人任務流程", definitionContent, true);
}
 
開發者ID:alibaba,項目名稱:bulbasaur,代碼行數:22,代碼來源:TaskTest.java

示例3: getApplicationId

import org.dom4j.DocumentException; //導入方法依賴的package包/類
/**
 * Get the packageId for the manifest file
 *
 * @param manifestFile
 * @return
 */
public static String getApplicationId(File manifestFile) {
    SAXReader reader = new SAXReader();
    if (manifestFile.exists()) {
        Document document = null;// Read the XML file
        try {
            document = reader.read(manifestFile);
            Element root = document.getRootElement();// Get the root node
            String packageName = root.attributeValue("package");
            return packageName;
        } catch (DocumentException e) {
            e.printStackTrace();
        }
    }
    return null;
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:22,代碼來源:ManifestFileUtils.java

示例4: getMapByXmlStr

import org.dom4j.DocumentException; //導入方法依賴的package包/類
/**
   * 解析XML字串得到Map對象
   * @author Rocye
   * @param xmlStr Xml字符串
   * @return Xml對應的Map對象
   * @version 2017.11.15
   */
  public static Map<String, Object> getMapByXmlStr(String xmlStr){
Document doc = null;
try {
	doc = DocumentHelper.parseText(xmlStr);
} catch (DocumentException e) {
	e.printStackTrace();
}
Map<String, Object> map = new HashMap<String, Object>();
if (doc == null){
	return map;
}
Element rootElement = doc.getRootElement();
Element2Map(rootElement, map);
return (Map<String, Object>)map.get("xml");
  }
 
開發者ID:rocye,項目名稱:wx-idk,代碼行數:23,代碼來源:Dom4jUtil.java

示例5: parseInitData

import org.dom4j.DocumentException; //導入方法依賴的package包/類
private Map<String, String> parseInitData(String data) {
    try {
        Map<String, String> ussData = new HashMap<>();
        Document document = DocumentHelper.parseText(data);
        Element root = document.getRootElement();
        Iterator iter = root.elementIterator();
        while (iter.hasNext()) {
            Element ele = (Element) iter.next();
            log.debug("name:" + ele.getName() + " value:" + ele.getStringValue());
            ussData.put(ele.getName(), ele.getStringValue());
        }

        // 隨機device id
        String deviceID = "e";
        for (int i = 0; i < 3; i++) {
            int randomNum = ThreadLocalRandom.current().nextInt(10000, 99999);
            deviceID += randomNum;
        }
        ussData.put("deviceID", deviceID);
        return ussData;
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    return null;
}
 
開發者ID:ingbyr,項目名稱:WechatBot,代碼行數:26,代碼來源:WechatBot.java

示例6: isSuiteXml

import org.dom4j.DocumentException; //導入方法依賴的package包/類
/**
 * 判斷是否為suite的xml配置
 * @param content
 * @return
 */
public static boolean isSuiteXml(byte[] content)
{
	SAXReader reader = new SAXReader();
	try
	{
		Document doc = reader.read(new ByteArrayInputStream(content));
		Element rootEle = doc.getRootElement();
		
		String rootEleName = rootEle.getName();
		
		return "suite".equals(rootEleName);
	}
	catch (DocumentException e)
	{
		e.printStackTrace();
	}
	
	return false;
}
 
開發者ID:LinuxSuRen,項目名稱:phoenix.webui.suite.runner,代碼行數:25,代碼來源:SuiteUtils.java

示例7: parse

import org.dom4j.DocumentException; //導入方法依賴的package包/類
public void parse(URL is) {
		SAXReader saxReader = new SAXReader();

		try {
			Document document = saxReader.read(is);
			Element root = document.getRootElement();
			
			collectProperty(root);
			parseAuth(root);
			parseApp(root);
//			
//			System.out.println("====================parse ok=============");
//			System.out.println(properties.toString());
//			System.out.println(authSetting.toString());
		} catch (DocumentException e) {
			log.error("Load route.xml error.");
			e.printStackTrace();
		}

	}
 
開發者ID:troopson,項目名稱:etagate,代碼行數:21,代碼來源:GateSetting.java

示例8: testdeployDefinition

import org.dom4j.DocumentException; //導入方法依賴的package包/類
@Test
public void testdeployDefinition() {
    // 初始化

    SAXReader reader = new SAXReader();
    // 拿不到信息
    URL url = this.getClass().getResource("/process12.xml");
    Document document = null;
    try {
        document = reader.read(url);
    } catch (DocumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    String definitionContent = document.asXML();
    // deploy first time
    DefinitionHelper.getInstance().deployDefinition("process", "測試流程", definitionContent, true);
}
 
開發者ID:alibaba,項目名稱:bulbasaur,代碼行數:20,代碼來源:PersistDefinationTest.java

示例9: xml2Map

import org.dom4j.DocumentException; //導入方法依賴的package包/類
public static Map<String, Object> xml2Map(InputStream xml){
    SAXReader saxReader = new SAXReader();
    Document doc;
    try {
        doc = saxReader.read(new InputStreamReader(xml));
        return document2Map(doc);
    } catch (DocumentException e) {
        e.printStackTrace();
        return null;
    }

}
 
開發者ID:szsucok,項目名稱:sucok-framework,代碼行數:13,代碼來源:XMLParse.java

示例10: getDocument

import org.dom4j.DocumentException; //導入方法依賴的package包/類
/**
 * 獲取document對象
 * @param file 讀取的文件對象
 * @return 返回Document對象
 */
public static Document getDocument(File file){
    // 創建saxReader對象
    SAXReader reader = new SAXReader();
    // 通過read方法讀取一個文件 轉換成Document對象
    Document document = null;
    try {
        document = reader.read(file);
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    return document;
}
 
開發者ID:javahaohao,項目名稱:gen_code,代碼行數:18,代碼來源:XmlParser.java

示例11: ConfigurationWrapper

import org.dom4j.DocumentException; //導入方法依賴的package包/類
private ConfigurationWrapper() {

        try {
            File configFile = getConfigFile();
            SAXReader saxReader = new SAXReader();
            Document document = saxReader.read(configFile);
            rootElement = document.getRootElement();
        } catch (DocumentException e) {
            e.printStackTrace();
        }
    }
 
開發者ID:Shiroukoji,項目名稱:FH-Manager,代碼行數:12,代碼來源:ConfigurationWrapper.java

示例12: initM2_HOME

import org.dom4j.DocumentException; //導入方法依賴的package包/類
private static void initM2_HOME() {
    M2_HOME = System.getenv("M2_HOME");
    if (null == M2_HOME) {
        throw new RuntimeException(resource.getString("m2_home.not.found"));
    }

    List<String> configPaths = new ArrayList<>();

    // ${user.home}/.m2/setting.xml
    String userHome = System.getProperty("user.home");
    StringBuilder sb = new StringBuilder(userHome);
    sb.append(File.separator)
            .append(".m2")
            .append(File.separator)
            .append("settings.xml");
    configPaths.add(sb.toString());

    // $M2_HOME/conf/settings.xml
    sb.delete(0, sb.length());
    sb.append(M2_HOME)
            .append(File.separator)
            .append("conf")
            .append(File.separator)
            .append("settings.xml");
    configPaths.add(sb.toString());

    try {
        LOCAL_REPOSITORY = readConfig(configPaths);
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    if (LOCAL_REPOSITORY == null) {
        throw new RuntimeException(resource.getString("maven.config.file.not.found"));
    }
}
 
開發者ID:pingcai,項目名稱:maven-package-gui-installer,代碼行數:36,代碼來源:Application.java

示例13: readXML

import org.dom4j.DocumentException; //導入方法依賴的package包/類
/**
 * 
 * @param xmlPath
 *            xml配置文件classpath路徑
 * @return xml配置文件內容
 */
public static String readXML(String xmlPath) {
	StringBuffer xmlBuffer = new StringBuffer();
	SAXReader reader = new SAXReader();
	try {
		Document xmlDoc = reader.read(ConfigUtil.class.getClassLoader().getResourceAsStream(xmlPath));
		xmlBuffer.append(xmlDoc.asXML());
	} catch (DocumentException e) {
		e.printStackTrace();
	}

	return xmlBuffer.toString();
}
 
開發者ID:jtjsir,項目名稱:zookeeper-test-demo,代碼行數:19,代碼來源:ConfigUtil.java

示例14: readXML

import org.dom4j.DocumentException; //導入方法依賴的package包/類
private Element readXML(String path){
	SAXReader reader=new SAXReader();
       Document document= null;
       try {
           document = reader.read(path);
       } catch (DocumentException e) {
           e.printStackTrace();
       }
       Element root=document.getRootElement();
       return root;
}
 
開發者ID:Hang-Hu,項目名稱:SimpleController,代碼行數:12,代碼來源:XMLManager.java

示例15: readDocument

import org.dom4j.DocumentException; //導入方法依賴的package包/類
/**
 * 讀取xml文件
 */
public static Document readDocument(String xmlFilePath) {
  // 創建SAXReader對象
  SAXReader reader = new SAXReader();
  // 讀取文件 轉換成Document
  Document document = null;
  try {
    document = reader.read(new File(xmlFilePath));
  } catch (DocumentException e) {
    e.printStackTrace();
  }
  return document;
}
 
開發者ID:SvenAugustus,項目名稱:Divinity_Original_Sin_2_zhCN,代碼行數:16,代碼來源:FileUtils.java


注:本文中的org.dom4j.DocumentException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。