Class Link
- All Implemented Interfaces:
ElementAttributeMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementClassListMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementConsumerMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementContainerMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementEventMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementHTMLMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementIdMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, ElementQueryMethods<HTMLAnchorElement>, ElementTextMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, HTMLElementAttributeMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, HTMLElementDataMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, HTMLElementStyleMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, HTMLElementVisibilityMethods<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>, IsElement<HTMLAnchorElement>, TypedBuilder<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>
The Link class represents a hyperlink element that creates hyperlinks using the
PlaceManager. It extends the
HTMLContainerBuilder class, which is a builder for container-like HTML elements.-
Method Summary
Modifier and TypeMethodDescriptionstatic Linklink(PlaceManager placeManager, String route) Creates a new Link instance based on the given PlaceManager and route.static Linklink(PlaceManager placeManager, String route, String... values) Creates a new Link instance for a route with parameter values.that()To make builders work with inheritance, sub-builders must return a reference to their instance.Methods inherited from class HTMLContainerBuilder
elementMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementHTMLMethods
html, htmlMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface ElementTextMethods
text, textMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hidden
-
Method Details
-
link
Creates a new Link instance for a route with parameter values. Values are encoded automatically — pass raw/decoded values.Example:
Link.link(placeManager, "/resource/:name", "my/file");
- Parameters:
placeManager- The PlaceManager used to resolve the route.route- The route template with:paramplaceholders.values- The raw parameter values in the order they appear in the route.- Returns:
- The new Link instance.
- Throws:
IllegalArgumentException- if the number of values doesn't match the number of parameters- See Also:
-
link
Creates a new Link instance based on the given PlaceManager and route.No encoding is applied — the route is used as-is.
- Parameters:
placeManager- The PlaceManager used to resolve the route.route- The route of the hyperlink.- Returns:
- The new Link instance.
-
that
Description copied from interface:TypedBuilderTo make builders work with inheritance, sub-builders must return a reference to their instance.- Specified by:
thatin interfaceTypedBuilder<HTMLAnchorElement, HTMLContainerBuilder<HTMLAnchorElement>>- Overrides:
thatin classHTMLContainerBuilder<HTMLAnchorElement>
-