Package com.crawljax.core.configuration
Class CrawlActionsBuilder
- java.lang.Object
-
- com.crawljax.core.configuration.CrawlActionsBuilder
-
public class CrawlActionsBuilder extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCrawlActionsBuilder.ExcludeByParentBuilder
-
Field Summary
Fields Modifier and Type Field Description private List<CrawlElement>crawlElementsprivate List<CrawlElement>crawlElementsExcludedprivate List<CrawlActionsBuilder.ExcludeByParentBuilder>crawlParentsExcludedprivate static org.slf4j.LoggerLOGprivate com.google.common.collect.ImmutableList<CrawlElement>resultingElementsExcluded
-
Constructor Summary
Constructors Constructor Description CrawlActionsBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) org.apache.commons.lang3.tuple.Pair<com.google.common.collect.ImmutableList<CrawlElement>,com.google.common.collect.ImmutableList<CrawlElement>>build()private voidcheckNotRead()CrawlElementclick(String tagName)Set of HTML elements Crawljax will click during crawling For example 1) >a.../< 2) <div/> click("a") will only include 1 if clickOnce is true (default).voidclick(String... tagNames)Set of HTML elements Crawljax will click during crawling For example 1) <a.../> 2) <div/> click("a") will only include 1 This set can be restricted bydontClick(String).voidclickDefaultElements()Includes HTML elements with Tags - Anchor, Button, Input.Submit, Input.Button Specifies that Crawljax should click all the default clickable elements.voidclickElementsWithClickEventHandler()Adds all HTML elements with a "click" event handler.CrawlElementdontClick(String tagName)Set of HTML elements Crawljax will NOT click during crawling When an HTML is present in the click and dontClick sets, then the element will not be clicked.CrawlActionsBuilder.ExcludeByParentBuilderdontClickChildrenOf(String tagName)Click no children of the specified parent element.CrawlElemententer(String tagName)private com.google.common.collect.ImmutableList<CrawlElement>getCrawlElements()private com.google.common.collect.ImmutableList<CrawlElement>getCrawlElementsExcluded()
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
crawlElements
private final List<CrawlElement> crawlElements
-
crawlElementsExcluded
private final List<CrawlElement> crawlElementsExcluded
-
crawlParentsExcluded
private final List<CrawlActionsBuilder.ExcludeByParentBuilder> crawlParentsExcluded
-
resultingElementsExcluded
private com.google.common.collect.ImmutableList<CrawlElement> resultingElementsExcluded
-
-
Method Detail
-
click
public CrawlElement click(String tagName)
Set of HTML elements Crawljax will click during crawling For example 1) >a.../< 2) <div/> click("a") will only include 1 if clickOnce is true (default). This set can be restricted bydontClick(String).- Parameters:
tagName- the tag name of the elements to be included- Returns:
- this CrawlElement
-
enter
public CrawlElement enter(String tagName)
-
click
public void click(String... tagNames)
Set of HTML elements Crawljax will click during crawling For example 1) <a.../> 2) <div/> click("a") will only include 1 This set can be restricted bydontClick(String). If no clicks are specified,clickDefaultElements()is enabled.- Parameters:
tagNames- the tag name of the elements to be included
-
clickDefaultElements
public void clickDefaultElements()
Includes HTML elements with Tags - Anchor, Button, Input.Submit, Input.Button Specifies that Crawljax should click all the default clickable elements. These include: All anchor tags All buttons
-
clickElementsWithClickEventHandler
public void clickElementsWithClickEventHandler()
Adds all HTML elements with a "click" event handler. Includes all default elements. seeclickDefaultElements()
-
checkNotRead
private void checkNotRead()
-
dontClick
public CrawlElement dontClick(String tagName)
Set of HTML elements Crawljax will NOT click during crawling When an HTML is present in the click and dontClick sets, then the element will not be clicked. For example: 1) <a href="#">Some text</a> 2) <a class="foo" .../> 3) <div class="foo" .../> click("a") dontClick("a").withAttribute("class", "foo"); Will include only include HTML element 2- Parameters:
tagName- the tag name of the elements to be excluded- Returns:
- crawlTag the CrawlElement
-
dontClickChildrenOf
public CrawlActionsBuilder.ExcludeByParentBuilder dontClickChildrenOf(String tagName)
Click no children of the specified parent element.- Parameters:
tagName- The tag name of which no children should be clicked.- Returns:
- The builder to append more options.
-
getCrawlElements
private com.google.common.collect.ImmutableList<CrawlElement> getCrawlElements()
- Returns:
- the crawlElements.
-
getCrawlElementsExcluded
private com.google.common.collect.ImmutableList<CrawlElement> getCrawlElementsExcluded()
- Returns:
- the crawlElementsExcluded
-
build
org.apache.commons.lang3.tuple.Pair<com.google.common.collect.ImmutableList<CrawlElement>,com.google.common.collect.ImmutableList<CrawlElement>> build()
- Returns:
- a
PairwherePair.getLeft()are the includes andPair.getRight()are the excludes.
-
-