Class HTMLLinkContext

java.lang.Object
org.archive.modules.extractor.LinkContext
org.archive.modules.extractor.HTMLLinkContext
All Implemented Interfaces:
Serializable

public class HTMLLinkContext
extends LinkContext
XPath-like context for HTML discovered URIs.
Author:
pjack
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • HTMLLinkContext

      protected HTMLLinkContext​(String path)
      Constructor.
      Parameters:
      path - an XPath-like context, eg "A\@HREF"
    • HTMLLinkContext

      protected HTMLLinkContext​(CharSequence element, CharSequence attribute)
  • Method Details

    • get

      public static HTMLLinkContext get​(CharSequence el, CharSequence attr)
      return an instance of HTMLLinkContext for attribute attr in element el. returns pre-allocated shared instance for common case, or new instance for others.
      Parameters:
      el - element name
      attr - attribute name
      Returns:
      instance of HTMLLinkContext
    • get

      public static HTMLLinkContext get​(String path)
      return an instance of HTMLLinkContext for path path. returns pre-allocated shared instance for common case, or new instance for others.

      TODO: most code calling this method builds path by concatenating element name and attribute name. consider changing such code to call get(CharSequence, CharSequence) instead.

      Parameters:
      path - element and attribute in XLink-like path notation
      Returns:
      instance of HTMLLinkContext
    • toString

      public String toString()
      Overrides:
      toString in class Object