|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Link.Builder
Builder class for hypermedia links.
Link
Method Summary | |
---|---|
Link |
build(Object... values)
Finish building this link using the supplied values as URI parameters. |
Link |
buildRelativized(UriInfo uriInfo,
Object... values)
Finish building this link using the supplied values as URI parameters and relativize the result with respect to the current request URI. |
Link |
buildResolved(UriInfo uriInfo,
Object... values)
Finish building this link using the supplied values as URI parameters and resolve the result using the base URI of the application as in UriInfo.resolve(java.net.URI) . |
Link.Builder |
link(Link link)
Initialize builder using another link. |
Link.Builder |
link(String link)
Initialize builder using another link represented as a string. |
Link.Builder |
param(String name,
String value)
Set an arbitrary parameter on this link. |
Link.Builder |
rel(String rel)
Convenience method to set a link relation. |
Link.Builder |
title(String title)
Convenience method to set a title on this link. |
Link.Builder |
type(String type)
Convenience method to set a type on this link. |
Link.Builder |
uri(String uri)
Set underlying string representing URI template for the link being constructed. |
Link.Builder |
uri(URI uri)
Set underlying URI template for the link being constructed. |
Link.Builder |
uriBuilder(UriBuilder uriBuilder)
Set underlying URI builder representing the URI template for the link being constructed. |
Method Detail |
---|
Link.Builder link(Link link)
link
- other link from which to initialize.
Link.Builder link(String link)
link ::= '<' uri '>' (';' link-param)* link-param ::= name '=' quoted-stringSee RFC 5988 for more information.
link
- other link in string representation.
IllegalArgumentException
- if string representation of URI is invalid.Link.Builder uri(URI uri)
uri
- underlying URI for link
Link.Builder uri(String uri)
uri
- underlying URI for link.
IllegalArgumentException
- if string representation of URI is invalid.Link.Builder uriBuilder(UriBuilder uriBuilder)
uriBuilder
- underlying URI builder.
Link.Builder rel(String rel)
rel
value can
be specified by using one or more whitespace characters as delimiters
according to RFC 5988. The effect of calling this method is cumulative;
relations are appended using a single space character as separator.
rel
- relation name.
IllegalArgumentException
- if the name is null
.Link.Builder title(String title)
title
on this link.
title
- title parameter of this link.
IllegalArgumentException
- if the title is null
.Link.Builder type(String type)
type
on this link.
type
- type parameter of this link.
IllegalArgumentException
- if the type is null
.Link.Builder param(String name, String value)
build(Object...)
.
name
- the name of the parameter.value
- the value set for the parameter.
IllegalArgumentException
- if either the name or value are null
.Link build(Object... values)
values
- parameters used to build underlying URI.
IllegalArgumentException
- if there are any URI template parameters
without a supplied value, or if a value is null
.
UriBuilderException
- if a URI cannot be constructed based on the
current state of the underlying URI builder.Link buildRelativized(UriInfo uriInfo, Object... values)
Finish building this link using the supplied values as URI parameters
and relativize the result with respect to the current request URI.
Link relativization is as described in UriInfo.relativize(java.net.URI)
.
If the two links do not share a prefix, the relativization step is skipped
and this method is equivalent to calling
build(java.lang.Object[])
.
uriInfo
- supplied instance of UriInfo for relativization.values
- parameters used to build underlying URI.
IllegalArgumentException
- if there are any URI template parameters
without a supplied value, or if a value is null
.
UriBuilderException
- if a URI cannot be constructed based on the current
state of the underlying URI builder.
IllegalStateException
- if the request URI is not available in context.UriInfo.relativize(java.net.URI)
Link buildResolved(UriInfo uriInfo, Object... values)
Finish building this link using the supplied values as URI parameters
and resolve the result using the base URI of the application as in
UriInfo.resolve(java.net.URI)
. If the underlying URI is
already absolute, the resolution step is omitted and this method is equivalent
to calling build(java.lang.Object[])
.
uriInfo
- supplied instance of UriInfo for resolution.values
- parameters used to build underlying URI.
IllegalArgumentException
- if there are any URI template parameters without
a supplied value, or if a value is null
.
UriBuilderException
- if a URI cannot be constructed based on the current
state of the underlying URI builderUriInfo.resolve(java.net.URI)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |