Search in sources :

Example 21 with SimpleElementSelector

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

the class Rgaa30Rule110102 method select.

@Override
protected void select(SSPHandler sspHandler) {
    selector = new SimpleElementSelector(LABEL_ELEMENT);
    selector.selectElements(sspHandler, labelElementHandler);
    putLabelElementHandlerIntoTheMap();
    selector.setCssLikeQuery(INPUT_ELEMENT_INSIDE_FORM_CSS_LIKE_QUERY);
    selector.selectElements(sspHandler, inputElementHandler);
    putInputElementHandlerIntoTheMap();
}
Also used : SimpleElementSelector(org.asqatasun.rules.elementselector.SimpleElementSelector)

Example 22 with SimpleElementSelector

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

the class Rgaa30Rule110103 method select.

@Override
protected void select(SSPHandler sspHandler) {
    selector = new SimpleElementSelector(INPUT_ELEMENT_WITH_ARIA_INSIDE_FORM_CSS_LIKE_QUERY);
    selector.selectElements(sspHandler, inputElementHandler);
    putInputElementHandlerIntoTheMap();
}
Also used : SimpleElementSelector(org.asqatasun.rules.elementselector.SimpleElementSelector)

Example 23 with SimpleElementSelector

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

the class Rgaa30Rule080301 method select.

@Override
protected void select(SSPHandler sspHandler) {
    new SimpleElementSelector(HTML_WITH_LANG_CSS_LIKE_QUERY).selectElements(sspHandler, htmlWithLangHandler);
    if (!htmlWithLangHandler.isEmpty()) {
        return;
    }
    new SimpleElementSelector(ELEMENT_WITH_LANG_ATTR_CSS_LIKE_QUERY).selectElements(sspHandler, elementWithLang);
    new SimpleElementSelector(ELEMENT_WITHOUT_LANG_ATTR_CSS_LIKE_QUERY).selectElements(sspHandler, elementWithoutLang);
    removeElementWithParentWithLangAttr();
}
Also used : SimpleElementSelector(org.asqatasun.rules.elementselector.SimpleElementSelector)

Example 24 with SimpleElementSelector

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

the class Rgaa30Rule100102 method select.

@Override
protected void select(SSPHandler sspHandler) {
    totalNumberOfElements = sspHandler.getTotalNumberOfElements();
    // retrieve element from the nomenclature
    Nomenclature deprecatedHtmlAttr = nomenclatureLoaderService.loadByCode(PRESENTATION_ATTR_NOM);
    for (String deprecatedAttr : deprecatedHtmlAttr.getValueList()) {
        SimpleElementSelector sec = new SimpleElementSelector(buildQuery(deprecatedAttr));
        ElementHandler<Element> eh = new ElementHandlerImpl();
        sec.selectElements(sspHandler, eh);
        attrElementHandlerMap.put(deprecatedAttr, eh);
    }
    // elements with width attribute that are not img
    SimpleElementSelector secWidthAttrNotImg = new SimpleElementSelector(ELEMENT_WITH_WITDH_ATTR_NOT_IMG_V2);
    ElementHandler<Element> ehWithAttrNotImg = new ElementHandlerImpl();
    secWidthAttrNotImg.selectElements(sspHandler, ehWithAttrNotImg);
    attrElementHandlerMap.put(WIDTH_ATTR, ehWithAttrNotImg);
    // elements with width attribute that are not img
    SimpleElementSelector secHeightAttrNotImg = new SimpleElementSelector(ELEMENT_WITH_HEIGHT_ATTR_NOT_IMG_V2);
    ElementHandler<Element> ehHeightAttrNotImg = new ElementHandlerImpl();
    secHeightAttrNotImg.selectElements(sspHandler, ehHeightAttrNotImg);
    attrElementHandlerMap.put(HEIGHT_ATTR, ehHeightAttrNotImg);
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature) Element(org.jsoup.nodes.Element) ElementHandlerImpl(org.asqatasun.ruleimplementation.ElementHandlerImpl) SimpleElementSelector(org.asqatasun.rules.elementselector.SimpleElementSelector)

Example 25 with SimpleElementSelector

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

the class Rgaa32016Rule100102 method select.

@Override
protected void select(SSPHandler sspHandler) {
    totalNumberOfElements = sspHandler.getTotalNumberOfElements();
    // retrieve element from the nomenclature
    Nomenclature deprecatedHtmlAttr = nomenclatureLoaderService.loadByCode(PRESENTATION_ATTR_NOM);
    for (String deprecatedAttr : deprecatedHtmlAttr.getValueList()) {
        SimpleElementSelector sec = new SimpleElementSelector(buildQuery(deprecatedAttr));
        ElementHandler<Element> eh = new ElementHandlerImpl();
        sec.selectElements(sspHandler, eh);
        attrElementHandlerMap.put(deprecatedAttr, eh);
    }
    // elements with width attribute that are not img
    SimpleElementSelector secWidthAttrNotImg = new SimpleElementSelector(ELEMENT_WITH_WITDH_ATTR_NOT_IMG_V2);
    ElementHandler<Element> ehWithAttrNotImg = new ElementHandlerImpl();
    secWidthAttrNotImg.selectElements(sspHandler, ehWithAttrNotImg);
    attrElementHandlerMap.put(WIDTH_ATTR, ehWithAttrNotImg);
    // elements with width attribute that are not img
    SimpleElementSelector secHeightAttrNotImg = new SimpleElementSelector(ELEMENT_WITH_HEIGHT_ATTR_NOT_IMG_V2);
    ElementHandler<Element> ehHeightAttrNotImg = new ElementHandlerImpl();
    secHeightAttrNotImg.selectElements(sspHandler, ehHeightAttrNotImg);
    attrElementHandlerMap.put(HEIGHT_ATTR, ehHeightAttrNotImg);
}
Also used : Nomenclature(org.asqatasun.entity.reference.Nomenclature) Element(org.jsoup.nodes.Element) ElementHandlerImpl(org.asqatasun.ruleimplementation.ElementHandlerImpl) SimpleElementSelector(org.asqatasun.rules.elementselector.SimpleElementSelector)

Aggregations

SimpleElementSelector (org.asqatasun.rules.elementselector.SimpleElementSelector)28 ElementSelector (org.asqatasun.rules.elementselector.ElementSelector)16 Element (org.jsoup.nodes.Element)13 ElementHandlerImpl (org.asqatasun.ruleimplementation.ElementHandlerImpl)9 Nomenclature (org.asqatasun.entity.reference.Nomenclature)4 InputFormElementWithExplicitLabelSelector (org.asqatasun.rules.elementselector.InputFormElementWithExplicitLabelSelector)4 InputFormElementWithInplicitLabelSelector (org.asqatasun.rules.elementselector.InputFormElementWithInplicitLabelSelector)3 TestSolution (org.asqatasun.entity.audit.TestSolution)1 ElementHandler (org.asqatasun.ruleimplementation.ElementHandler)1 CompositeLinkElementSelector (org.asqatasun.rules.elementselector.CompositeLinkElementSelector)1 LinkElementSelector (org.asqatasun.rules.elementselector.LinkElementSelector)1 MultipleElementSelector (org.asqatasun.rules.elementselector.MultipleElementSelector)1