Package org.archive.modules.extractor
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.archive.modules.extractor.LinkContext
LinkContext.SimpleLinkContext
-
Field Summary
Fields Modifier and Type Field Description static HTMLLinkContext
A_HREF
static HTMLLinkContext
IMG_DATA_ORIGINAL
static HTMLLinkContext
IMG_DATA_ORIGINAL_SET
static HTMLLinkContext
IMG_DATA_SRC
static HTMLLinkContext
IMG_DATA_SRCSET
static HTMLLinkContext
IMG_SRC
static HTMLLinkContext
IMG_SRCSET
static HTMLLinkContext
META
static HTMLLinkContext
META_HREF
static HTMLLinkContext
SCRIPT_SRC
static HTMLLinkContext
SOURCE_DATA_ORIGINAL_SET
static HTMLLinkContext
SOURCE_SRCSET
Fields inherited from class org.archive.modules.extractor.LinkContext
EMBED_MISC, INFERRED_MISC, JS_MISC, MANIFEST_MISC, NAVLINK_MISC, PREREQ_MISC, SPECULATIVE_MISC
-
Constructor Summary
Constructors Modifier Constructor Description protected
HTMLLinkContext(CharSequence element, CharSequence attribute)
protected
HTMLLinkContext(String path)
Constructor. -
Method Summary
Modifier and Type Method Description static HTMLLinkContext
get(CharSequence el, CharSequence attr)
return an instance of HTMLLinkContext for attributeattr
in elementel
.static HTMLLinkContext
get(String path)
return an instance of HTMLLinkContext for pathpath
.String
toString()
Methods inherited from class org.archive.modules.extractor.LinkContext
equals, hashCode
-
Field Details
-
META
-
A_HREF
-
IMG_SRC
-
IMG_SRCSET
-
SOURCE_SRCSET
-
IMG_DATA_SRC
-
IMG_DATA_SRCSET
-
IMG_DATA_ORIGINAL
-
IMG_DATA_ORIGINAL_SET
-
SOURCE_DATA_ORIGINAL_SET
-
SCRIPT_SRC
-
META_HREF
-
-
Constructor Details
-
HTMLLinkContext
Constructor.- Parameters:
path
- an XPath-like context, eg "A\@HREF"
-
HTMLLinkContext
-
-
Method Details
-
get
return an instance of HTMLLinkContext for attributeattr
in elementel
. returns pre-allocated shared instance for common case, or new instance for others.- Parameters:
el
- element nameattr
- attribute name- Returns:
- instance of HTMLLinkContext
-
get
return an instance of HTMLLinkContext for pathpath
. 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
-