程序包 com.ijpay.core

类 XmlHelper

java.lang.Object
com.ijpay.core.XmlHelper

public class XmlHelper extends Object
xpath解析xml
     文档地址:
     http://www.w3school.com.cn/xpath/index.asp
 
作者:
L.cm
  • 方法详细资料

    • of

      public static XmlHelper of(InputStream is)
    • of

      public static XmlHelper of(File file)
    • of

      public static XmlHelper of(String xmlStr)
    • getString

      public String getString(String expression)
      获取String
      参数:
      expression - 路径
      返回:
      String
    • getBoolean

      public Boolean getBoolean(String expression)
      获取Boolean
      参数:
      expression - 路径
      返回:
      String
    • getNumber

      public Number getNumber(String expression)
      获取Number
      参数:
      expression - 路径
      返回:
      {Number}
    • getNode

      public Node getNode(String expression)
      获取某个节点
      参数:
      expression - 路径
      返回:
      {Node}
    • getNodeList

      public NodeList getNodeList(String expression)
      获取子节点
      参数:
      expression - 路径
      返回:
      NodeList
    • getString

      public String getString(Object node, String expression)
      获取String
      参数:
      node - 节点
      expression - 相对于node的路径
      返回:
      String
    • getBoolean

      public Boolean getBoolean(Object node, String expression)
      获取
      参数:
      node - 节点
      expression - 相对于node的路径
      返回:
      String
    • getNumber

      public Number getNumber(Object node, String expression)
      获取
      参数:
      node - 节点
      expression - 相对于node的路径
      返回:
      {Number}
    • getNode

      public Node getNode(Object node, String expression)
      获取某个节点
      参数:
      node - 节点
      expression - 路径
      返回:
      {Node}
    • getNodeList

      public NodeList getNodeList(Object node, String expression)
      获取子节点
      参数:
      node - 节点
      expression - 相对于node的路径
      返回:
      NodeList
    • toMap

      public Map<String,String> toMap()
      针对没有嵌套节点的简单处理
      返回:
      map集合