Class EventableConditionChecker


  • public class EventableConditionChecker
    extends Object
    Check whether the conditions of an eventable are satisfied.
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • eventableConditions

        private final com.google.common.collect.ImmutableList<EventableCondition> eventableConditions
    • Constructor Detail

      • EventableConditionChecker

        @Inject
        public EventableConditionChecker​(CrawlRules config)
    • Method Detail

      • checkXpathStartsWithXpathEventableCondition

        public boolean checkXpathStartsWithXpathEventableCondition​(Document dom,
                                                                   EventableCondition eventableCondition,
                                                                   String xpath)
                                                            throws XPathExpressionException
        Checks whether an XPath expression starts with an XPath eventable condition.
        Parameters:
        dom - The DOM String.
        eventableCondition - The eventable condition.
        xpath - The XPath.
        Returns:
        boolean whether xpath starts with xpath location of eventable condition xpath condition
        Throws:
        XPathExpressionException
        CrawljaxException - when eventableCondition is null or its inXPath has not been set
      • checkXPathUnderXPaths

        public boolean checkXPathUnderXPaths​(String xpath,
                                             List<String> xpathsList)
        Parameters:
        xpath - the xpath to check if its under a certain set of full-xPaths.
        xpathsList - the set of full-length-xPaths
        Returns:
        true if the xpath is under one of the full-length-xpaths.