当前位置: 首页>>代码示例>>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;未经允许,请勿转载。