Package org.jboss.resteasy.specimpl
Class LinkBuilderImpl
java.lang.Object
org.jboss.resteasy.specimpl.LinkBuilderImpl
- All Implemented Interfaces:
Link.Builder
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URIA map for all the link parameters such as "rel", "type", etc.protected UriBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the base URI as a string for resolution of relative URIs.Set the base URI for resolution of relative URIs.Finish building this link using the supplied values as URI parameters.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.Initialize builder using another link.Initialize builder using another link represented as a string.Set an arbitrary parameter on this link.Convenience method to set a link relation.Convenience method to set atitleon this link.Convenience method to set atypeon this link.Set underlying string representing URI template for the link being constructed.Set underlying URI template for the link being constructed.uriBuilder(UriBuilder uriBuilder) Set underlying URI builder representing the URI template for the link being constructed.
-
Field Details
-
map
A map for all the link parameters such as "rel", "type", etc. -
uriBuilder
-
baseUri
-
-
Constructor Details
-
LinkBuilderImpl
public LinkBuilderImpl()
-
-
Method Details
-
link
Description copied from interface:Link.BuilderInitialize builder using another link. Sets underlying URI and copies all parameters.- Specified by:
linkin interfaceLink.Builder- Parameters:
link- other link from which to initialize.- Returns:
- the updated builder.
-
link
Description copied from interface:Link.BuilderInitialize 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-stringSee RFC 5988 for more information.- Specified by:
linkin interfaceLink.Builder- Parameters:
link- other link in string representation.- Returns:
- the updated builder.
-
uriBuilder
Description copied from interface:Link.BuilderSet underlying URI builder representing the URI template for the link being constructed.- Specified by:
uriBuilderin interfaceLink.Builder- Parameters:
uriBuilder- underlying URI builder.- Returns:
- the updated builder.
-
uri
Description copied from interface:Link.BuilderSet underlying URI template for the link being constructed.- Specified by:
uriin interfaceLink.Builder- Parameters:
uri- underlying URI for link- Returns:
- the updated builder.
-
uri
Description copied from interface:Link.BuilderSet underlying string representing URI template for the link being constructed.- Specified by:
uriin interfaceLink.Builder- Parameters:
uri- underlying URI for link.- Returns:
- the updated builder.
- Throws:
IllegalArgumentException- if string representation of URI is invalid.
-
rel
Description copied from interface:Link.BuilderConvenience method to set a link relation. More than onerelvalue 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.- Specified by:
relin interfaceLink.Builder- Parameters:
rel- relation name.- Returns:
- the updated builder.
-
title
Description copied from interface:Link.BuilderConvenience method to set atitleon this link.- Specified by:
titlein interfaceLink.Builder- Parameters:
title- title parameter of this link.- Returns:
- the updated builder.
-
type
Description copied from interface:Link.BuilderConvenience method to set atypeon this link.- Specified by:
typein interfaceLink.Builder- Parameters:
type- type parameter of this link.- Returns:
- the updated builder.
-
param
Description copied from interface:Link.BuilderSet 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 callingLink.Builder.build(Object...).- Specified by:
paramin interfaceLink.Builder- Parameters:
name- the name of the parameter.value- the value set for the parameter.- Returns:
- the updated builder.
- Throws:
IllegalArgumentException- if either the name or value arenull.
-
build
Description copied from interface:Link.BuilderFinish 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.- Specified by:
buildin interfaceLink.Builder- Parameters:
values- parameters used to build underlying URI.- Returns:
- newly built link.
- Throws:
UriBuilderException- if a URI cannot be constructed based on the current state of the underlying URI builder.
-
buildRelativized
Description copied from interface:Link.BuilderFinish 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 callingLink.Builder.build(java.lang.Object[]). Note that a base URI can be set on a relative link usingLink.Builder.baseUri(java.net.URI). The state of the builder is unaffected; this method may be called multiple times on the same builder instance.- Specified by:
buildRelativizedin interfaceLink.Builder- Parameters:
uri- URI used for relativization.values- parameters used to build underlying URI.- Returns:
- newly built link.
- See Also:
-
baseUri
Description copied from interface:Link.BuilderSet the base URI for resolution of relative URIs. If the underlying URI is already absolute, the base URI is ignored.- Specified by:
baseUriin interfaceLink.Builder- Parameters:
uri- base URI for relative links.- Returns:
- the updated builder.
- See Also:
-
baseUri
Description copied from interface:Link.BuilderSet the base URI as a string for resolution of relative URIs. If the underlying URI is already absolute, the base URI is ignored.- Specified by:
baseUriin interfaceLink.Builder- Parameters:
uri- base URI for relative links.- Returns:
- the updated builder.
- See Also:
-