zoukankan      html  css  js  c++  java
  • (转载)Htmlparser Filter 简要归纳

    1 . 逻辑关系:与或非

     

    AndFilter()           Creates a new instance of an AndFilter.
    AndFilter(NodeFilter[] predicates)           Creates an AndFilter that accepts nodes acceptable to all given filters.
    AndFilter(NodeFilter left, NodeFilter right)           Creates an AndFilter that accepts nodes acceptable to both filters.

     

     

     

    OrFilter()           Creates a new instance of an OrFilter.
    OrFilter(NodeFilter[] predicates)           Creates an OrFilter that accepts nodes acceptable to any of the given filters.
    OrFilter(NodeFilter left, NodeFilter right)           Creates an OrFilter that accepts nodes acceptable to either filter.

     

     

     

    OrFilter()           Creates a new instance of an OrFilter.
    OrFilter(NodeFilter[] predicates)           Creates an OrFilter that accepts nodes acceptable to any of the given filters.
    OrFilter(NodeFilter left, NodeFilter right)           Creates an OrFilter that accepts nodes acceptable to either filter.

     

    2. 内容

    StringFilter:功能简单有限;复杂功能可使用RegexFilter (正则表达式)

     

    StringFilter()           Creates a new instance of StringFilter that accepts all string nodes.
    StringFilter(String pattern)           Creates a StringFilter that accepts text nodes containing a string.
    StringFilter(String pattern, boolean sensitive)           Creates a StringFilter that accepts text nodes containing a string.
    StringFilter(String pattern, boolean sensitive, Locale locale)           Creates a StringFilter that accepts text nodes containing a string.

     

     

    RegexFilter()           Creates a new instance of RegexFilter that accepts string nodes matching the regular expression ".*" using the FIND strategy.
    RegexFilter(String pattern)           Creates a new instance of RegexFilter that accepts string nodes matching a regular expression using the FIND strategy.
    RegexFilter(String pattern, int strategy)           Creates a new instance of RegexFilter that accepts string nodes matching a regular expression.

     

     

    3 标签

    TagNameFilter()利用标签名过滤 : div ,img , ...

    NodeClassFilter()利用标签类别 :LinkTag.class ...

    HasAttributeFilter()利用属性 :HasAttributeFilter(“class”, “className”)

    LinkRegexFilter()用正则表达式匹配链接

     

    TagNameFilter()           Creates a new instance of TagNameFilter.
    TagNameFilter(String name)           Creates a TagNameFilter that accepts tags with the given name.

     

     

    NodeClassFilter()           Creates a NodeClassFilter that accepts Html tags.
    NodeClassFilter(Class cls)           Creates a NodeClassFilter that accepts tags of the given class.
    HasAttributeFilter()           Creates a new instance of HasAttributeFilter.
    HasAttributeFilter(String attribute)           Creates a new instance of HasAttributeFilter that accepts tags with the given attribute.
    HasAttributeFilter(String attribute, String value)           Creates a new instance of HasAttributeFilter that accepts tags with the given attribute and value.
    LinkRegexFilter(String regexPattern)           Creates a LinkRegexFilter that accepts LinkTag nodes containing a URL that matches the supplied regex pattern.
    LinkRegexFilter(String regexPattern, boolean caseSensitive)           Creates a LinkRegexFilter that accepts LinkTag nodes containing a URL that matches the supplied regex pattern.
    LinkStringFilter(String pattern)           Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern.
    LinkStringFilter(String pattern, boolean caseSensitive)           Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern.

     

     

    4 层次关系

     

    HasParentFilter()           Creates a new instance of HasParentFilter.
    HasParentFilter(NodeFilter filter)           Creates a new instance of HasParentFilter that accepts nodes with the direct parent acceptable to the filter.
    HasParentFilter(NodeFilter filter, boolean recursive)           Creates a new instance of HasParentFilter that accepts nodes with a parent acceptable to the filter.

     

     

    HasChildFilter()           Creates a new instance of a HasChildFilter.
    HasChildFilter(NodeFilter filter)           Creates a new instance of HasChildFilter that accepts nodes with a direct child acceptable to the filter.
    HasChildFilter(NodeFilter filter, boolean recursive)           Creates a new instance of HasChildFilter that accepts nodes with a child acceptable to the filter.

    原博出处:http://blog.sina.com.cn/s/blog_4a2cf9700100hqj9.html

  • 相关阅读:
    虚拟内存思想
    虚拟内存映射 段分割 vm_area_struct
    进程、内存的理想与现实 VS 虚拟内存
    进程地址空间
    MMU CPU及思想
    链接器和加载器 好书
    编译器 链接器 加载器
    链接器简介
    C编译器、链接器、加载器详解
    静态库是.o文件的集合与弱符号
  • 原文地址:https://www.cnblogs.com/WonderHow/p/3304284.html
Copyright © 2011-2022 走看看