Class ContentInternalLinks

  • All Implemented Interfaces:
    LinkExtractor

    public final class ContentInternalLinks
    extends java.lang.Object
    implements LinkExtractor
    Generic extractor that is able to detect any "internal" links produced by wcm.io Link Handler.

    It used very basic heuristic and looks for any JSON elements with a properties "url" property, and a "type=internal" property.

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContentInternalLinks

        public ContentInternalLinks()
    • 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 interface LinkExtractor
        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 interface LinkExtractor
        Parameters:
        jsonPathContext - Document context
        Returns:
        Link URLs