程序包 org.anyline.util

类 DomUtil

java.lang.Object
org.anyline.util.DomUtil

public class DomUtil extends Object
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static List<org.dom4j.Element>
    afters(org.dom4j.Element element, String tag)
    当前节点后的所有节点
    static List<org.dom4j.Element>
    befores(org.dom4j.Element element, String tag)
    当前节点前的所有节点
    static List<org.dom4j.Element>
    betweens(org.dom4j.Element start, org.dom4j.Element end, String... tags)
    start与end之间的所有节点
    static org.dom4j.Element
    element(org.dom4j.Element root, String tags)
    根据标签name搜索element
    static org.dom4j.Element
    element(org.dom4j.Element root, String attribute, String value)
    根据属性值搜索element
    static org.dom4j.Element
    element(org.dom4j.Element root, String tags, String attribute, String value)
     
    static org.dom4j.Element
    element(org.dom4j.Element root, List<String> tags)
    根据标签name搜索element
    static org.dom4j.Element
    element(org.dom4j.Element root, List<String> tags, String attribute, String value)
    根据标签name以及属性值搜索element
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, String tags)
     
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, String tags, boolean recursion)
     
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, String attribute, String value)
    根据属性值搜索element
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, String tags, String attribute, String value)
     
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, List<String> tags)
     
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, List<String> tags, boolean recursion)
    根据标签name搜索element
    static List<org.dom4j.Element>
    elements(org.dom4j.Element root, List<String> tags, String attribute, String value)
    根据标签name以及属性值搜索element
    static String
     
    static String
    format(org.dom4j.Document document)
     
    static String
    format(org.dom4j.Node note)
     
    static void
    remove(org.dom4j.Element parent, List<org.dom4j.Element> removes)
    删除parent下的removes节点

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • DomUtil

      public DomUtil()
  • 方法详细资料

    • element

      public static org.dom4j.Element element(org.dom4j.Element root, List<String> tags)
      根据标签name搜索element
      参数:
      root - 根节点
      tags - 标签名(不含namespace)
      返回:
      Element
    • element

      public static org.dom4j.Element element(org.dom4j.Element root, String tags)
      根据标签name搜索element
      参数:
      root - 根节点
      tags - 标签名(不含namespace)
      返回:
      Element
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, List<String> tags, boolean recursion)
      根据标签name搜索element
      参数:
      root - 根节点
      tags - 标签名(不含namespace)
      recursion - 递归查询子类
      返回:
      List
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, String tags, boolean recursion)
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, List<String> tags)
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, String tags)
    • element

      public static org.dom4j.Element element(org.dom4j.Element root, List<String> tags, String attribute, String value)
      根据标签name以及属性值搜索element
      参数:
      root - 根节点
      tags - 标签名(不含namespace)
      attribute - 属性名(不含namespace)
      value - 属性值
      返回:
      Element
    • element

      public static org.dom4j.Element element(org.dom4j.Element root, String tags, String attribute, String value)
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, List<String> tags, String attribute, String value)
      根据标签name以及属性值搜索element
      参数:
      root - 根节点
      tags - 标签名(不含namespace)
      attribute - 属性名(不含namespace)
      value - 属性值
      返回:
      List
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, String tags, String attribute, String value)
    • element

      public static org.dom4j.Element element(org.dom4j.Element root, String attribute, String value)
      根据属性值搜索element
      参数:
      root - 根节点
      attribute - 属性名(不含namespace)
      value - 属性值
      返回:
      Element
    • elements

      public static List<org.dom4j.Element> elements(org.dom4j.Element root, String attribute, String value)
      根据属性值搜索element
      参数:
      root - 根节点
      attribute - 属性名(不含namespace)
      value - 属性值
      返回:
      List
    • format

      public static String format(String xml)
    • format

      public static String format(org.dom4j.Document document)
    • format

      public static String format(org.dom4j.Node note)
    • afters

      public static List<org.dom4j.Element> afters(org.dom4j.Element element, String tag)
      当前节点后的所有节点
      参数:
      element - element
      tag - 过滤标签
      返回:
      List
    • befores

      public static List<org.dom4j.Element> befores(org.dom4j.Element element, String tag)
      当前节点前的所有节点
      参数:
      element - element
      tag - 过滤标签
      返回:
      List
    • betweens

      public static List<org.dom4j.Element> betweens(org.dom4j.Element start, org.dom4j.Element end, String... tags)
      start与end之间的所有节点
      参数:
      start - 开始
      end - 结束
      tags - 过滤
      返回:
      List
    • remove

      public static void remove(org.dom4j.Element parent, List<org.dom4j.Element> removes)
      删除parent下的removes节点
      参数:
      parent - parent
      removes - removes