}
}
public static class TextInLinkPredicate implements HTMLElementPredicate {
public boolean matchesCriteria(Object htmlElement, Object criteria) {
WebLink link = (WebLink) htmlElement;
String textToMatch = (String) criteria;
Node item = link.getDOMSubtree().getAttributes().getNamedItem("accesskey");
if (item != null) {
return item.getNodeValue().equals(String.valueOf(AccessKeyTransformer.getAccessKey(textToMatch)));
} else {
return WebLink.MATCH_CONTAINED_TEXT.matchesCriteria(htmlElement, criteria);
}