Class representing hypermedia links. A hypermedia link may include additional parameters beyond its underlying URI.
Parameters such as rel or type provide additional meta-data. Links in responses can be
followed by creating an jakarta. or a
jakarta..
The methods toString and valueOf can be used to serialize and de-serialize a link into a link
header (RFC 5988).
jakarta.ws.rs.client.Client#invocation , jakarta.ws.rs.client.Client#target(jakarta.ws.rs.core.Link) , jakarta.ws.rs.core.Response#getLink(java.lang.String)
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Link.
Builder class for hypermedia links. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | REL
Rel link param from RFC 5988. |
| public static final String | TITLE
Title link param from RFC 5988. |
| public static final String | TYPE
Type link param from RFC 5988. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Link. | |
| public static Link. | Returns: the updated Link.Builder.the resource containing the method. resource, final String the name of the method whose method)jakarta. value will be used to obtain the path to append.Convenience method to build a link from a resource. |
| public static Link. | |
| public static Link. | Returns: a newlink builder instance.a root resource whose resource)jakarta. value will be used to initialize the builder.Convenience method to build a link from a resource. |
| public static Link. | |
| public static Link. | |
| public static Link. | Returns: a new builder.instance of URI builder. uriBuilder)Create a new builder instance initialized from a URI builder. |
| public abstract Map | Returns: immutable map of link parameters.Returns an immutable map that includes all the link parameters defined on this link. |
| public abstract String | Returns: relation types as string ornull.Returns the value associated with the link |
| public abstract List | Returns: relation types as list of strings or empty list.Returns the value associated with the link |
| public abstract String | Returns: value of title parameter ornull.Returns the value associated with the link |
| public abstract String | Returns: value of type parameter ornull.Returns the value associated with the link |
| public abstract URI | |
| public abstract UriBuilder | Returns: UriBuilder initialized using underlying URI.Convenience method that returns a |
| public abstract String | Returns: string link header representation for this link.Overrides java. Returns a string representation as a link header (RFC 5988). |
| public static Link |
| REL | back to summary |
|---|---|
| public static final String REL Rel link param from RFC 5988. | |
| TITLE | back to summary |
|---|---|
| public static final String TITLE Title link param from RFC 5988. | |
| TYPE | back to summary |
|---|---|
| public static final String TYPE Type link param from RFC 5988. | |
| Link | back to summary |
|---|---|
| public Link() | |
| fromLink | back to summary |
|---|---|
| public static Link. Create a new builder instance initialized from another link. | |
| fromMethod | back to summary |
|---|---|
| public static Link. Convenience method to build a link from a resource. Equivalent to
| |
| fromPath | back to summary |
|---|---|
| public static Link. Convenience method to build a link from a path. Equivalent to
| |
| fromResource | back to summary |
|---|---|
| public static Link. Convenience method to build a link from a resource. Equivalent to
| |
| fromUri | back to summary |
|---|---|
| public static Link. Create a new builder instance initialized from an existing URI.
| |
| fromUri | back to summary |
|---|---|
| public static Link. Create a new builder instance initialized from an existing URI represented as a string.
| |
| fromUriBuilder | back to summary |
|---|---|
| public static Link. Create a new builder instance initialized from a URI builder.
| |
| getParams | back to summary |
|---|---|
| public abstract Map Returns an immutable map that includes all the link parameters defined on this link. If defined, this map will
include entries for | |
| getRel | back to summary |
|---|---|
| public abstract String getRel() Returns the value associated with the link
| |
| getRels | back to summary |
|---|---|
| public abstract List Returns the value associated with the link | |
| getTitle | back to summary |
|---|---|
| public abstract String getTitle() Returns the value associated with the link
| |
| getType | back to summary |
|---|---|
| public abstract String getType() Returns the value associated with the link
| |
| getUri | back to summary |
|---|---|
| public abstract URI getUri() Returns the underlying URI associated with this link.
| |
| getUriBuilder | back to summary |
|---|---|
| public abstract UriBuilder getUriBuilder() Convenience method that returns a
| |
| toString | back to summary |
|---|---|
| public abstract String toString() Overrides java. Returns a string representation as a link header (RFC 5988). All link params are serialized as link-param="value" where value is a quoted-string. For example, <http://foo.bar/employee/john>; title="employee"; rel="manager friend" | |
| valueOf | back to summary |
|---|---|
| public static Link valueOf(final String value) Simple parser to convert link header string representations into a link.
link ::= '<' uri 'gt;' (';' link-param)*
link-param ::= name '=' quoted-string
See RFC 5988 for more information.
| |
Link
| Modifier and Type | Method and Description |
|---|---|
| public Link. | |
| public Link. | |
| public Link | |
| public Link | Returns: newly built link.URI used for relativization. uri, Object... parameters used to build underlying URI. values)Finish building this link using the supplied values as URI parameters and relativize the result with respect to the supplied URI. |
| public Link. | |
| public Link. | |
| public Link. | |
| public Link. | |
| public Link. | |
| public Link. | |
| public Link. | |
| public Link. | |
| public Link. | Returns: the updated builder.underlying URI builder. uriBuilder)Set underlying URI builder representing the URI template for the link being constructed. |
| baseUri | back to summary |
|---|---|
| public Link. Set the base URI for resolution of relative URIs. If the underlying URI is already absolute, the base URI is ignored.
| |
| baseUri | back to summary |
|---|---|
| public Link. Set the base URI as a string for resolution of relative URIs. If the underlying URI is already absolute, the base URI is ignored.
| |
| build | back to summary |
|---|---|
| public Link build(Object... values) Finish building this link using the supplied values as URI parameters. The state of the builder is unaffected; this method may be called multiple times on the same builder instance.
| |
| buildRelativized | back to summary |
|---|---|
| public Link buildRelativized(URI uri, Object... values) Finish building this link using the supplied values as URI parameters and relativize the result with respect to the
supplied URI.
If the underlying link is already relative or if it is absolute but does not share a prefix with the supplied URI,
this method is equivalent to calling
| |
| link | back to summary |
|---|---|
| public Link. Initialize builder using another link. Sets underlying URI and copies all parameters. | |
| link | back to summary |
|---|---|
| public Link. Initialize builder using another link represented as a string. Uses simple parser to convert string representation into a link.
link ::= '<' uri 'gt;' (';' link-param)*
link-param ::= name '=' quoted-string
See RFC 5988 for more information.
| |
| param | back to summary |
|---|---|
| public Link. Set an arbitrary parameter on this link. Note that link parameters are those defined in RFC 5988 and should not be
confused with URI parameters which can be specified when calling
| |
| rel | back to summary |
|---|---|
| public Link. Convenience method to set a link relation. More than one
| |
| title | back to summary |
|---|---|
| public Link. Convenience method to set a
| |
| type | back to summary |
|---|---|
| public Link. Convenience method to set a
| |
| uri | back to summary |
|---|---|
| public Link. Set underlying URI template for the link being constructed. | |
| uri | back to summary |
|---|---|
| public Link. Set underlying string representing URI template for the link being constructed.
| |
| uriBuilder | back to summary |
|---|---|
| public Link. Set underlying URI builder representing the URI template for the link being constructed.
| |