Package org.htmlparser.filters

Examples of org.htmlparser.filters.AndFilter


    return dateFormat.format(date);
  }

  public int countOfTagWithClassBelowTagWithIdPrefix(String childTag, String tagClass, String parentTag, String parentIdPrefix) throws Exception {
    NodeList parents = getMatchingTags(
            new AndFilter(
                    new TagNameFilter(parentTag),
                    new HasAttributePrefixFilter("id", parentIdPrefix))
    );

    NodeFilter predicates[] = {
            new TagNameFilter(childTag),
            new HasAttributeFilter("class", tagClass)
    };
    NodeFilter filter = new AndFilter(predicates);
    NodeList matches = parents.extractAllNodesThatMatch(filter, true);
    return matches.size();
  }
View Full Code Here


            throw new IOException2("cannot parse rcov report file", e);
        }
    }

    protected TableTag getReportTable(Parser htmlParser) throws ParserException {
        final AndFilter filter = new AndFilter(new TagNameFilter(TABLE_TAG_NAME),
                new HasAttributeFilter(CLASS_ATTR_NAME, REPORT_CLASS_VALUE));

        NodeList reportNode = htmlParser.extractAllNodesThatMatch(filter);
        if (!(reportNode != null && reportNode.size() > 0)) {
            throw new ParserException("cannot parse rcov report file, report element wasn't found");
View Full Code Here

    private String parseSourceInTableDetails(String html) throws FileNotFoundException, ParserException, IOException {
        String source = null;

        final Parser htmlParser = initParser(html);
        final AndFilter filter = new AndFilter(new TagNameFilter(TABLE_TAG_NAME),
                new HasAttributeFilter(CLASS_ATTR_NAME, "details"));

        NodeList reportNode = htmlParser.extractAllNodesThatMatch(filter);
        if (reportNode != null && reportNode.size() > 0) {
            source = ((TableTag) reportNode.elements().nextNode()).toHtml(true);
View Full Code Here

TOP

Related Classes of org.htmlparser.filters.AndFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.