public class Hyperlink extends Object
Modifier and Type | Field and Description |
---|---|
Element |
element
The Element representing the hyperlink.
|
Constructor and Description |
---|
Hyperlink(Element anchorElement,
UserAgent userAgent)
Creates a Hyperlink component to represent the specified anchor element.
|
Modifier and Type | Method and Description |
---|---|
Document |
follow()
Performs a virtual click of the hyperlink; directs the UserAgent to the url specified by the href property.
|
Element |
getElement()
Retrieves the Element for the hyperlink.
|
String |
getHref()
Returns the href value of the hyperlink or null if the href attribute does not exist.
|
public Element element
public Hyperlink(Element anchorElement, UserAgent userAgent) throws NotFound
userAgent
- the userAgent.anchorElement
- the element for this hyperlink; the element must contain an href attribute, otherwise a NotFound Exception is thrown.NotFound
public Element getElement()
public String getHref()
public Document follow() throws ResponseException
ResponseException