国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

XmlUtil

2019-11-06 06:38:57
字體:
來源:轉載
供稿:網友
import java.io.File;import org.apache.commons.lang.StringUtils;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.dom4j.Document;import org.dom4j.DocumentException;import org.dom4j.Element;import org.dom4j.io.SAXReader;public class xmlUtil{    /* the log. */    PRivate static final Log log = LogFactory.getLog(XmlUtil.class.getName());    /**     * Get the Document for response XML file.     *      * @param filePath     *            filePath     *      * @return Document     */    public static Document getDocument(String filePath)    {        Document document = null;        try        {            if (StringUtils.isBlank(filePath))            {                log.error("input param filePath is null.");                return document;            }                        document = new SAXReader().read(new File(filePath));        }        catch (DocumentException e)        {            log.error("getDocument failed.", e);        }        return document;    }    /**     * Judge the element whether has children.     *      * @param el     *            . Element Object.     * @return boolean true/false.     */    public static boolean hasChildren(Element el)    {        if (el.hasContent() && el.elements().size() > 0)        {            return true;        }        return false;    }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 兴义市| 余干县| 仪征市| 南丹县| 石阡县| 永修县| 大宁县| 溆浦县| 延川县| 锡林浩特市| 绥芬河市| 朝阳区| 全南县| 潼南县| 璧山县| 农安县| 平定县| 台东县| 和田县| 新宁县| 凤城市| 汉川市| 横峰县| 山阳县| 塔河县| 溧水县| 高陵县| 祥云县| 庆安县| 磴口县| 辽中县| 公主岭市| 淮安市| 凉城县| 兴业县| 阜南县| 禹城市| 金堂县| 金堂县| 思南县| 麻栗坡县|