use of org.asqatasun.rules.elementchecker.text.TextLengthChecker in project Asqatasun by Asqatasun.
the class SeoRule01013 method check.
@Override
protected void check(final SSPHandler sspHandler, final TestSolutionHandler testSolutionHandler) {
if (elementHandler.isEmpty() || elementHandler.get().size() > 1) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
ElementChecker checker = new TextLengthChecker(new TextAttributeOfElementBuilder(AttributeStore.CONTENT_ATTR), MAX_META_DESC_LENGTH, META_DESC_EXCEEDS_LIMIT_MSG, // evidence elements
AttributeStore.CONTENT_ATTR);
checker.check(sspHandler, elementHandler, testSolutionHandler);
}
use of org.asqatasun.rules.elementchecker.text.TextLengthChecker in project Asqatasun by Asqatasun.
the class SeoRule06031 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (elementHandler.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
// in case of more than one title, keep the first.
if (elementHandler.get().size() > 1) {
Element element = elementHandler.get().iterator().next();
elementHandler.clean().add(element);
}
ElementChecker checker = new TextLengthChecker(new SimpleTextElementBuilder(), TITLE_MAX_LENGTH, TITLE_EXCEEDS_LIMIT_MSG, // evidence elements
HtmlElementStore.TEXT_ELEMENT2);
checker.check(sspHandler, elementHandler, testSolutionHandler);
}
Aggregations