Class RichTextInternalLinks
- java.lang.Object
-
- io.wcm.siteapi.integrationtestsupport.linkextractor.RichTextInternalLinks
-
- All Implemented Interfaces:
LinkExtractor
public final class RichTextInternalLinks extends java.lang.Object implements LinkExtractor
Extracts internal links from rich text fragments in JSON.Looks for components with specific resource types and a "text" property containing the HTML fragment. Within the HTML fragments anchor tags with a attribute "data-type=internal" are processed, which is the default representation of internal links generated by wcm.io Link Handler.
-
-
Constructor Summary
Constructors Constructor Description RichTextInternalLinks(java.lang.String... resourceTypes)
RichTextInternalLinks(java.util.List<java.lang.String> resourceTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.lang.String suffix)
Returns true if the link extractor accepts the given suffix (processor mapped to this suffix).java.util.stream.Stream<java.lang.String>
getLinks(com.jayway.jsonpath.DocumentContext jsonPathContext)
Retrieves links from the JSON document via JSON path.
-
-
-
Constructor Detail
-
RichTextInternalLinks
public RichTextInternalLinks(java.lang.String... resourceTypes)
- Parameters:
resourceTypes
- Resource type(s) for components containing rich text.
-
RichTextInternalLinks
public RichTextInternalLinks(java.util.List<java.lang.String> resourceTypes)
- Parameters:
resourceTypes
- Resource type(s) for components containing rich text.
-
-
Method Detail
-
accept
public boolean accept(java.lang.String suffix)
Description copied from interface:LinkExtractor
Returns true if the link extractor accepts the given suffix (processor mapped to this suffix).- Specified by:
accept
in interfaceLinkExtractor
- Parameters:
suffix
- Suffix- Returns:
- true if JSON response of this processor is supported
-
getLinks
public java.util.stream.Stream<java.lang.String> getLinks(com.jayway.jsonpath.DocumentContext jsonPathContext)
Description copied from interface:LinkExtractor
Retrieves links from the JSON document via JSON path.- Specified by:
getLinks
in interfaceLinkExtractor
- Parameters:
jsonPathContext
- Document context- Returns:
- Link URLs
-
-