public class LinkExtractor extends DefaultCallback
Modifier and Type | Field and Description |
---|---|
Set<String> |
urls
The URLs resulting from the parsing process.
|
EMPTY_CALLBACK_ARRAY
Constructor and Description |
---|
LinkExtractor() |
Modifier and Type | Method and Description |
---|---|
String |
base()
Returns the URL specified by the BASE element.
|
void |
configure(BulletParser parser)
Configure the parser to parse elements and certain attributes.
|
String |
metaLocation()
Returns the URL specified by META HTTP-EQUIV elements of location type.
|
String |
metaRefresh()
Returns the URL specified by META HTTP-EQUIV elements of refresh type.
|
void |
startDocument()
Receive notification of the beginning of the document.
|
boolean |
startElement(Element element,
Map<Attribute,MutableString> attrMap)
Receive notification of the start of an element.
|
cdata, characters, endDocument, endElement, getInstance
public void configure(BulletParser parser)
The required attributes are SRC , HREF , HTTP-EQUIV , and CONTENT .
configure
in interface Callback
configure
in class DefaultCallback
public void startDocument()
Callback
The callback must use this method to reset its internal state so that it can be resued. It must be safe to invoke this method several times.
startDocument
in interface Callback
startDocument
in class DefaultCallback
public boolean startElement(Element element, Map<Attribute,MutableString> attrMap)
Callback
For simple elements, this is the only notification that the callback will ever receive.
startElement
in interface Callback
startElement
in class DefaultCallback
element
- the element whose opening tag was found.attrMap
- a map from Attribute
s to MutableString
s.public String metaLocation()
null
result iff there is at least one META HTTP-EQUIV
element specifying a location URL (if there is more than one, we keep the first one).null
.public String base()
null
result iff there is at least one BASE element specifying a derelativisation URL
(if there is more than one, we keep the first one).null
.public String metaRefresh()
null
result iff there is at least one META HTTP-EQUIV
element specifying a refresh URL (if there is more than one, we keep the first one).null
.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.