Search in sources :

Example 6 with CompositeChecker

use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.

the class Rgaa30Rule010202 method getMarkerElementChecker.

/**
     * 
     * @return the checker user for marked elements
     */
private ElementChecker getMarkerElementChecker() {
    CompositeChecker ec = new CompositeChecker(new TextEmptinessChecker(new TextAttributeOfElementBuilder(ALT_ATTR), new ImmutablePair(PASSED, ""), new ImmutablePair(FAILED, DECORATIVE_ELEMENT_WITH_NOT_EMPTY_ALT_MSG), ALT_ATTR, TITLE_ATTR), new AttributePresenceChecker(TITLE_ATTR, new ImmutablePair(FAILED, DECORATIVE_ELEMENT_WITH_TITLE_ATTR_MSG), new ImmutablePair(PASSED, ""), ALT_ATTR, TITLE_ATTR));
    ec.setIsOrCombinaison(false);
    return ec;
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) TextAttributeOfElementBuilder(org.asqatasun.rules.textbuilder.TextAttributeOfElementBuilder) TextEmptinessChecker(org.asqatasun.rules.elementchecker.text.TextEmptinessChecker) CompositeChecker(org.asqatasun.rules.elementchecker.CompositeChecker) AttributePresenceChecker(org.asqatasun.rules.elementchecker.attribute.AttributePresenceChecker)

Example 7 with CompositeChecker

use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.

the class Rgaa30Rule010201 method getMarkerElementChecker.

/**
     * 
     * @return the checker user for marked elements
     */
private ElementChecker getMarkerElementChecker() {
    CompositeChecker ec = new CompositeChecker(new TextEmptinessChecker(new TextAttributeOfElementBuilder(ALT_ATTR), new ImmutablePair(PASSED, ""), new ImmutablePair(FAILED, DECORATIVE_ELEMENT_WITH_NOT_EMPTY_ALT_MSG), ALT_ATTR, TITLE_ATTR, SRC_ATTR), new AttributePresenceChecker(TITLE_ATTR, new ImmutablePair(FAILED, DECORATIVE_ELEMENT_WITH_TITLE_ATTR_MSG), new ImmutablePair(PASSED, ""), ALT_ATTR, TITLE_ATTR, SRC_ATTR));
    ec.setIsOrCombinaison(false);
    return ec;
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) TextAttributeOfElementBuilder(org.asqatasun.rules.textbuilder.TextAttributeOfElementBuilder) TextEmptinessChecker(org.asqatasun.rules.elementchecker.text.TextEmptinessChecker) CompositeChecker(org.asqatasun.rules.elementchecker.CompositeChecker) AttributePresenceChecker(org.asqatasun.rules.elementchecker.attribute.AttributePresenceChecker)

Example 8 with CompositeChecker

use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.

the class Rgaa30Rule010301 method getMarkerElementChecker.

/**
     * 
     * @return the checker user for marked elements
     */
private ElementChecker getMarkerElementChecker() {
    CompositeChecker ec = new CompositeChecker(// checker for elements identified by marker
    new AttributePertinenceChecker(ALT_ATTR, // check emptiness
    true, // compare with src attribute
    new TextAttributeOfElementBuilder(SRC_ATTR), // compare attribute value with nomenclature
    IMAGE_FILE_EXTENSION_NOM, // not pertinent message
    NOT_PERTINENT_ALT_MSG, // manual check message
    CHECK_ALT_PERTINENCE_OF_INFORMATIVE_IMG_MSG, // evidence elements
    ALT_ATTR, TITLE_ATTR, SRC_ATTR), new TextNotIdenticalToAttributeChecker(new TextAttributeOfElementBuilder(TITLE_ATTR), new TextAttributeOfElementBuilder(ALT_ATTR), new ImmutablePair(PASSED, ""), new ImmutablePair(FAILED, TITLE_NOT_IDENTICAL_TO_ALT_MSG), // evidence elements
    ALT_ATTR, TITLE_ATTR, SRC_ATTR));
    ec.setIsOrCombinaison(false);
    return ec;
}
Also used : TextNotIdenticalToAttributeChecker(org.asqatasun.rules.elementchecker.text.TextNotIdenticalToAttributeChecker) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) TextAttributeOfElementBuilder(org.asqatasun.rules.textbuilder.TextAttributeOfElementBuilder) AttributePertinenceChecker(org.asqatasun.rules.elementchecker.pertinence.AttributePertinenceChecker) CompositeChecker(org.asqatasun.rules.elementchecker.CompositeChecker)

Aggregations

ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)8 CompositeChecker (org.asqatasun.rules.elementchecker.CompositeChecker)8 TextAttributeOfElementBuilder (org.asqatasun.rules.textbuilder.TextAttributeOfElementBuilder)8 AttributePresenceChecker (org.asqatasun.rules.elementchecker.attribute.AttributePresenceChecker)4 AttributePertinenceChecker (org.asqatasun.rules.elementchecker.pertinence.AttributePertinenceChecker)4 TextEmptinessChecker (org.asqatasun.rules.elementchecker.text.TextEmptinessChecker)4 TextNotIdenticalToAttributeChecker (org.asqatasun.rules.elementchecker.text.TextNotIdenticalToAttributeChecker)4