use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.
the class Rgaa30Rule010301 method getLocalRegularElementChecker.
/**
*
* @return the checker user for not marked elements
*/
private ElementChecker getLocalRegularElementChecker() {
CompositeChecker compositeChecker = new CompositeChecker(ALT_ATTR, TITLE_ATTR, SRC_ATTR);
compositeChecker.addChecker(new AttributePertinenceChecker(ALT_ATTR, // check emptiness
true, // compare with src attribute
new TextAttributeOfElementBuilder(SRC_ATTR), // compare attribute value with nomenclature
IMAGE_FILE_EXTENSION_NOM, // solution when not pertinent
FAILED, // not pertinent message
"", // manual check message
""));
compositeChecker.addChecker(new TextNotIdenticalToAttributeChecker(new TextAttributeOfElementBuilder(ALT_ATTR), new TextAttributeOfElementBuilder(TITLE_ATTR), new ImmutablePair(FAILED, ""), new ImmutablePair(PASSED, "")));
compositeChecker.setIsOrCombinaison(false);
compositeChecker.addCheckMessageFromSolution(NEED_MORE_INFO, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_AND_ALT_PERTINENCE_MSG));
compositeChecker.addCheckMessageFromSolution(FAILED, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_WITH_NOT_PERTINENT_ALT_MSG));
return compositeChecker;
}
use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.
the class Rgaa30Rule010202 method getLocalRegularElementChecker.
/**
*
* @return the checker user for not marked elements
*/
private ElementChecker getLocalRegularElementChecker() {
CompositeChecker compositeChecker = new CompositeChecker(new TextEmptinessChecker(new TextAttributeOfElementBuilder(ALT_ATTR), new ImmutablePair(PASSED, ""), new ImmutablePair(FAILED, "")), new AttributePresenceChecker(TITLE_ATTR, new ImmutablePair(FAILED, ""), new ImmutablePair(PASSED, "")));
compositeChecker.setIsOrCombinaison(false);
compositeChecker.addCheckMessageFromSolution(PASSED, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_WITH_EMPTY_ALT_MSG));
compositeChecker.addCheckMessageFromSolution(FAILED, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_WITH_NOT_EMPTY_ALT_MSG));
return compositeChecker;
}
use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.
the class Rgaa30Rule010302 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(HREF_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, HREF_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, HREF_ATTR));
ec.setIsOrCombinaison(false);
return ec;
}
use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.
the class Rgaa30Rule010302 method getLocalRegularElementChecker.
/**
*
* @return the checker user for not marked elements
*/
private ElementChecker getLocalRegularElementChecker() {
CompositeChecker compositeChecker = new CompositeChecker(ALT_ATTR, TITLE_ATTR, HREF_ATTR);
compositeChecker.addChecker(new AttributePertinenceChecker(ALT_ATTR, // check emptiness
true, // compare with src attribute
new TextAttributeOfElementBuilder(HREF_ATTR), // compare attribute value with nomenclature
IMAGE_FILE_EXTENSION_NOM, // solution when not pertinent
FAILED, // not pertinent message
"", // manual check message
""));
compositeChecker.addChecker(new TextNotIdenticalToAttributeChecker(new TextAttributeOfElementBuilder(ALT_ATTR), new TextAttributeOfElementBuilder(TITLE_ATTR), new ImmutablePair(FAILED, ""), new ImmutablePair(PASSED, "")));
compositeChecker.setIsOrCombinaison(false);
compositeChecker.addCheckMessageFromSolution(NEED_MORE_INFO, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_AND_ALT_PERTINENCE_MSG));
compositeChecker.addCheckMessageFromSolution(FAILED, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_WITH_NOT_PERTINENT_ALT_MSG));
return compositeChecker;
}
use of org.asqatasun.rules.elementchecker.CompositeChecker in project Asqatasun by Asqatasun.
the class Rgaa30Rule010201 method getLocalRegularElementChecker.
/**
*
* @return the checker user for not marked elements
*/
private ElementChecker getLocalRegularElementChecker() {
CompositeChecker compositeChecker = new CompositeChecker(ALT_ATTR, TITLE_ATTR, SRC_ATTR);
compositeChecker.addChecker(new TextEmptinessChecker(new TextAttributeOfElementBuilder(ALT_ATTR), new ImmutablePair(PASSED, ""), new ImmutablePair(FAILED, "")));
compositeChecker.addChecker(new AttributePresenceChecker(TITLE_ATTR, new ImmutablePair(FAILED, ""), new ImmutablePair(PASSED, "")));
compositeChecker.setIsOrCombinaison(false);
compositeChecker.addCheckMessageFromSolution(PASSED, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_WITH_EMPTY_ALT_MSG));
compositeChecker.addCheckMessageFromSolution(FAILED, Collections.singletonMap(NEED_MORE_INFO, RemarkMessageStore.CHECK_NATURE_OF_IMAGE_WITH_NOT_EMPTY_ALT_MSG));
return compositeChecker;
}
Aggregations