public class Xml4jTools extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 构造器和说明 |
|---|
Xml4jTools() |
Xml4jTools(org.dom4j.Document document) |
Xml4jTools(File xml) |
Xml4jTools(InputStream in) |
Xml4jTools(List list) |
Xml4jTools(Map map) |
Xml4jTools(String xmlString) |
Xml4jTools(String xmlString,
String charsetName) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
format() |
org.dom4j.Document |
getDocument() |
static List<org.dom4j.Element> |
getNodeList(org.dom4j.Element ele,
String nodeString)
获取 Element 列表
|
List<org.dom4j.Element> |
getNodeList(String nodeString)
获取 Element 列表
|
static String |
getNodeValue(org.dom4j.Element ele,
String nodeString)
获取 Element 内容
|
String |
getNodeValue(String nodeString)
获取 Element 内容
|
org.dom4j.Element |
getRootElement() |
static org.dom4j.io.SAXReader |
getSAXReader() |
List |
toList() |
Map |
toMap() |
String |
toString() |
static String |
toString(org.dom4j.Element element) |
void |
writer(File newXmlFile) |
void |
writer(File newXmlFile,
String charset) |
Map |
xmltoMap() |
static Map |
xmltoMap(String xml) |
public Xml4jTools(org.dom4j.Document document)
xml - public Xml4jTools()
public Xml4jTools(String xmlString)
xmlString - public Xml4jTools(String xmlString, String charsetName)
xmlString - charsetName - UTF-8public Xml4jTools(InputStream in)
xmlString - public Xml4jTools(File xml)
xml - public Xml4jTools(Map map)
public Xml4jTools(List list)
list - public org.dom4j.Document getDocument()
public org.dom4j.Element getRootElement()
public static String toString(org.dom4j.Element element)
element - public void writer(File newXmlFile)
newXmlFile - public List<org.dom4j.Element> getNodeList(String nodeString)
nodeString - public static String getNodeValue(org.dom4j.Element ele, String nodeString)
ele - nodeString - public static List<org.dom4j.Element> getNodeList(org.dom4j.Element ele, String nodeString)
ele - nodeString - public Map xmltoMap()
public List toList()
public Map toMap()
public static org.dom4j.io.SAXReader getSAXReader()
throws SAXException
SAXExceptionCopyright © 2020. All rights reserved.