Search in sources :

Example 1 with AreaLinkElementSelector

use of org.asqatasun.rules.elementselector.AreaLinkElementSelector in project Asqatasun by Asqatasun.

the class Rgaa22Rule06031 method select.

@Override
protected void select(SSPHandler sspHandler) {
    /* the image link element selector */
    LinkElementSelector compositeLinkElementSelector = new CompositeLinkElementSelector(false, true);
    ElementHandler<Element> elHandler = new ElementHandlerImpl();
    compositeLinkElementSelector.selectElements(sspHandler, elHandler);
    for (Element el : compositeLinkElementSelector.getDecidableElements().get()) {
        if (doesElementHaveRequestedTargetAttribute(el)) {
            compositeLinks.add(el);
        }
    }
    LinkElementSelector areaLinkElementSelector = new AreaLinkElementSelector(false);
    elHandler.clean();
    areaLinkElementSelector.selectElements(sspHandler, elHandler);
    for (Element el : areaLinkElementSelector.getDecidableElements().get()) {
        if (doesElementHaveRequestedTargetAttribute(el)) {
            compositeLinks.add(el);
        }
    }
}
Also used : AreaLinkElementSelector(org.asqatasun.rules.elementselector.AreaLinkElementSelector) CompositeLinkElementSelector(org.asqatasun.rules.elementselector.CompositeLinkElementSelector) AreaLinkElementSelector(org.asqatasun.rules.elementselector.AreaLinkElementSelector) LinkElementSelector(org.asqatasun.rules.elementselector.LinkElementSelector) Element(org.jsoup.nodes.Element) ElementHandlerImpl(org.asqatasun.ruleimplementation.ElementHandlerImpl) CompositeLinkElementSelector(org.asqatasun.rules.elementselector.CompositeLinkElementSelector)

Aggregations

ElementHandlerImpl (org.asqatasun.ruleimplementation.ElementHandlerImpl)1 AreaLinkElementSelector (org.asqatasun.rules.elementselector.AreaLinkElementSelector)1 CompositeLinkElementSelector (org.asqatasun.rules.elementselector.CompositeLinkElementSelector)1 LinkElementSelector (org.asqatasun.rules.elementselector.LinkElementSelector)1 Element (org.jsoup.nodes.Element)1