| 构造器和说明 |
|---|
DefaultDom() |
| 限定符和类型 | 方法和说明 |
|---|---|
Element |
element(Element e,
String name)
Get a element by name
|
List<Element> |
elements(Element e)
Get the children elements
|
List<Element> |
elements(Element e,
String name)
Get the children elements by element name
|
Document |
getDocument(String file)
Get the XML document
|
Element |
getRoot(Document doc)
Get the root node
|
String |
getTextValue(Element valueElement)
Get the value of a XML element
|
String |
getTextValueByTagName(Element e,
String name)
Get the value of a XML node
|
String |
getTextValueByTagName(Element e,
String name,
String defaultValue)
Get the value of a XML node
|
public Document getDocument(String file)
DomgetDocument 在接口中 Domfile - The file relative pathpublic List<Element> elements(Element e, String name)
Dompublic String getTextValue(Element valueElement)
DomgetTextValue 在接口中 DomvalueElement - The value nodepublic String getTextValueByTagName(Element e, String name)
DomgetTextValueByTagName 在接口中 Dome - Current XML elementname - The child node namepublic String getTextValueByTagName(Element e, String name, String defaultValue)
DomgetTextValueByTagName 在接口中 Dome - Current XML elementname - The child node namedefaultValue - Default text value, when the child node is not found or the
child node has not text value, the method return itCopyright © 2016. All rights reserved.