Class A
- Direct Known Subclasses:
Hyperlink
The anchor element creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL. It is one of the most fundamental elements for web navigation.
Examples:
The following convenience methods are provided for constructing instances of this bean:
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionA()Creates an emptyAelement.Creates anAelement with the specifiedhref(Object)attribute andHtmlElementMixed.children(Object[])nodes. -
Method Summary
Methods inherited from class org.apache.juneau.bean.html5.HtmlElementMixed
child, children, getChild, getChild, getChild, getChildren, setChildrenMethods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
A
public A()Creates an emptyAelement. -
A
Creates anAelement with the specifiedhref(Object)attribute andHtmlElementMixed.children(Object[])nodes.- Parameters:
href- Thehref(Object)attribute. Can benull , in which case the attribute is stored with anull value (not removed).children- TheHtmlElementMixed.children(Object[])nodes. Must not benull .
-
-
Method Details
-
download
download attribute.Whether to download the resource instead of navigating to it, and its file name if so.
-
href
href attribute.Address of the hyperlink.
The value can be of any of the following types:
URI,URL,String. Strings must be valid URIs.URIs defined by
UriResolvercan be used for values. -
hreflang
hreflang attribute.Specifies the language of the linked resource. Used for SEO and accessibility purposes.
Examples:
"en" - English"es" - Spanish"fr" - French"de" - German"zh" - Chinese"ja" - Japanese
- Parameters:
value- The language code of the linked resource. Can benull to unset the attribute.- Returns:
- This object.
-
rel
rel attribute.Specifies the relationship between the current document and the linked resource.
Common values:
"alternate" - Alternative version of the page"author" - Link to the author of the page"bookmark" - Permalink for bookmarking"external" - External link"help" - Link to help documentation"license" - Link to license information"next" - Next page in a sequence"nofollow" - Don't follow this link for SEO"noreferrer" - Don't send referrer information"prev" - Previous page in a sequence"search" - Link to search functionality"tag" - Tag for the current page
- Parameters:
value- The relationship between the document and linked resource. Can benull to unset the attribute.- Returns:
- This object.
-
target
target attribute.Specifies where to open the linked resource when the link is clicked.
Common values:
"_blank" - Open in a new window/tab"_self" - Open in the same frame (default)"_parent" - Open in the parent frame"_top" - Open in the full body of the window"framename" - Open in a named frame
- Parameters:
value- Where to open the linked resource. Can benull to unset the attribute.- Returns:
- This object.
-
type
type attribute.Specifies the MIME type of the linked resource. Helps browsers determine how to handle the resource.
Common values:
"text/html" - HTML document"text/css" - CSS stylesheet"application/pdf" - PDF document"image/png" - PNG image"application/zip" - ZIP archive
- Parameters:
value- The MIME type of the linked resource. Can benull to unset the attribute.- Returns:
- This object.
-