类 DomMapper

java.lang.Object
org.macrocloud.kernel.http.DomMapper

public class DomMapper extends Object
爬虫 xml 转 bean 基于 jsoup
作者:
macro
  • 构造器详细资料

    • DomMapper

      public DomMapper()
  • 方法详细资料

    • asDocument

      public static org.jsoup.nodes.Document asDocument(ResponseSpec response)
      Returns body to jsoup Document.
      返回:
      Document
    • readDocument

      public static org.jsoup.nodes.Document readDocument(InputStream inputStream)
      将流读取为 jsoup Document
      参数:
      inputStream - InputStream
      返回:
      Document
    • readDocument

      public static org.jsoup.nodes.Document readDocument(String html)
      将 html 字符串读取为 jsoup Document
      参数:
      html - String
      返回:
      Document
    • readValue

      public static <T> T readValue(InputStream inputStream, Class<T> clazz)
      读取 xml 信息为 java Bean
      类型参数:
      T - 泛型
      参数:
      inputStream - InputStream
      clazz - bean Class
      返回:
      对象
    • readValue

      public static <T> T readValue(String html, Class<T> clazz)
      读取 xml 信息为 java Bean
      类型参数:
      T - 泛型
      参数:
      html - html String
      clazz - bean Class
      返回:
      对象
    • readValue

      public static <T> T readValue(org.jsoup.nodes.Element doc, Class<T> clazz)
      读取 xml 信息为 java Bean
      类型参数:
      T - 泛型
      参数:
      doc - xml element
      clazz - bean Class
      返回:
      对象
    • readList

      public static <T> List<T> readList(InputStream inputStream, Class<T> clazz)
      读取 xml 信息为 java Bean
      类型参数:
      T - 泛型
      参数:
      inputStream - InputStream
      clazz - bean Class
      返回:
      对象
    • readList

      public static <T> List<T> readList(String html, Class<T> clazz)
      读取 xml 信息为 java Bean
      类型参数:
      T - 泛型
      参数:
      html - html String
      clazz - bean Class
      返回:
      对象
    • readList

      public static <T> List<T> readList(org.jsoup.nodes.Element doc, Class<T> clazz)
      读取 xml 信息为 java Bean
      类型参数:
      T - 泛型
      参数:
      doc - xml element
      clazz - bean Class
      返回:
      对象列表