Class DomLinkExtractorConfig
java.lang.Object
com.norconex.crawler.web.doc.operations.link.impl.DomLinkExtractorConfig
Configuration for DomLinkExtractor.
- Since:
- 3.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExtractSelectors(List<String> selectors) addLinkSelector(String selector) Adds a new link selector extracting the "text" from matches.addLinkSelector(String selector, String extract) addNoExtractSelectors(List<String> selectors) protected booleanvoidClears all restrictions.booleanThe assumed source character encoding.The matcher of content types to apply link extraction on.Matcher of one or more fields to use as the source of content to extract links from, instead of the document content.The parser to use when creating the DOM-tree.Gets all restrictionsGets the schemes to be extracted.inthashCode()booleanWhether to ignore extra data associated with a link.booleanremoveLinkSelector(String selector) setCharset(Charset charset) The assumed source character encoding.setContentTypeMatcher(TextMatcher matcher) The matcher of content types to apply link extraction on.setExtractSelectors(List<String> selectors) Only apply link selectors to portions of a document matching the supplied selectors.setFieldMatcher(TextMatcher fieldMatcher) setIgnoreLinkData(boolean ignoreLinkData) Whether to ignore extra data associated with a link.setIgnoreNofollow(boolean ignoreNofollow) setNoExtractSelectors(List<String> selectors) Do not apply link selectors to portions of a document matching the supplied selectors.The parser to use when creating the DOM-tree.setSchemes(List<String> schemes) Sets the schemes to be extracted.toString()
-
Field Details
-
DEFAULT_SCHEMES
-
-
Constructor Details
-
DomLinkExtractorConfig
public DomLinkExtractorConfig()
-
-
Method Details
-
setFieldMatcher
-
setContentTypeMatcher
The matcher of content types to apply link extraction on. No attempt to extract links from any other content types will be made. Default isCommonMatchers.HTML_CONTENT_TYPES.- Parameters:
matcher- content type matcher- Returns:
- this
-
addLinkSelector
Adds a new link selector extracting the "text" from matches.- Parameters:
selector- JSoup selector- Returns:
- this
-
addLinkSelector
-
removeLinkSelector
-
clearLinkSelectors
-
getExtractSelectors
-
setExtractSelectors
Only apply link selectors to portions of a document matching the supplied selectors.- Parameters:
selectors- the CSS selectors- Returns:
- this
-
addExtractSelectors
-
getNoExtractSelectors
-
setNoExtractSelectors
Do not apply link selectors to portions of a document matching the supplied selectors.- Parameters:
selectors- the CSS selectors- Returns:
- this
-
addNoExtractSelectors
-
getSchemes
Gets the schemes to be extracted.- Returns:
- schemes to be extracted
-
setSchemes
Sets the schemes to be extracted.- Parameters:
schemes- schemes to be extracted- Returns:
- this
-
clearRestrictions
public void clearRestrictions()Clears all restrictions. -
getRestrictions
Gets all restrictions- Returns:
- the restrictions
-
getContentTypeMatcher
The matcher of content types to apply link extraction on. No attempt to extract links from any other content types will be made. Default isCommonMatchers.DOM_CONTENT_TYPES. -
getFieldMatcher
Matcher of one or more fields to use as the source of content to extract links from, instead of the document content. -
getLinkSelectors
-
getCharset
The assumed source character encoding. -
getParser
The parser to use when creating the DOM-tree. -
isIgnoreNofollow
public boolean isIgnoreNofollow() -
isIgnoreLinkData
public boolean isIgnoreLinkData()Whether to ignore extra data associated with a link. -
setCharset
The assumed source character encoding.- Returns:
this.
-
setParser
The parser to use when creating the DOM-tree.- Returns:
this.
-
setIgnoreNofollow
- Returns:
this.
-
setIgnoreLinkData
Whether to ignore extra data associated with a link.- Returns:
this.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-