Interface URIBuilderForResource
For localized resources, methods that do not provide a Locale
parameter will use the current request's
locale (the one returned by method SessionContext.getLocale()
).
-
Method Summary
Modifier and TypeMethodDescriptionbuildForResource
(ResourceType aResourceType, String aResourceName) Builds a URI of the specified web resource from the current module using current request's locale.buildForResource
(ResourceType aResourceType, String aResourceName, Locale aLocale) Builds aURI
of the specified web resource from the current module for the specified locale.buildForResource
(SchemaNode aSchemaNode, Object aValue) Builds aURI
for a the web resource specified by a node value.buildForResource
(String aResourcePath) Builds aURI
for the specified web resource.fromResource
(ResourceType aResourceType, String aResourceName) Creates a newUriBuilder
instance for the current module using current request's locale.fromResource
(ResourceType aResourceType, String aResourceName, Locale aLocale) Creates a newUriBuilder
instance for the current module.fromResource
(SchemaNode aSchemaNode, Object aValue) Creates a newUriBuilder
instance for the current module and a node value.fromResource
(String aResourcePath) Creates a newUriBuilder
instance representing aURI
initialized fromthis
builder state and the provided resource path.
-
Method Details
-
buildForResource
Builds aURI
for the specified web resource.The built-in
URI
does not hold any query parameter.Calling this method is the same as calling
this.fromResource(aResourcePath).build()
.- See Also:
-
fromResource
Creates a newUriBuilder
instance representing aURI
initialized fromthis
builder state and the provided resource path.Overriding already provided values is not supported and must be avoided. These values can be: the scheme, the host, the port, the root path or some query parameters
- Parameters:
aResourcePath
- resource path interpreted as relative to the module (web application).
-
buildForResource
URI buildForResource(ResourceType aResourceType, String aResourceName) throws IllegalArgumentException Builds a URI of the specified web resource from the current module using current request's locale.Calling this method is same as calling
this.fromResource(aResourceType, aResourceName).build();
. -
fromResource
UriBuilder fromResource(ResourceType aResourceType, String aResourceName) throws IllegalArgumentException Creates a newUriBuilder
instance for the current module using current request's locale.Overriding already provided values is not supported and must be avoided. These values can be: the scheme, the host, the port, the root path or some query parameters.
- Parameters:
aResourceType
- the resource typeaResourceName
- the resource name- Throws:
IllegalArgumentException
- if the providedResourceType
isnull
-
buildForResource
URI buildForResource(ResourceType aResourceType, String aResourceName, Locale aLocale) throws IllegalArgumentException Builds aURI
of the specified web resource from the current module for the specified locale.Calling this method is the same as calling
this.fromResource(aResourceType, aResourceName, aLocale).build();
.- Throws:
IllegalArgumentException
- See Also:
-
fromResource
UriBuilder fromResource(ResourceType aResourceType, String aResourceName, Locale aLocale) throws IllegalArgumentException Creates a newUriBuilder
instance for the current module.Overriding already provided values is not supported and must be avoided. These values can be: the scheme, the host, the port, the root path or some query parameters.
- Parameters:
aResourceType
- the resource typeaResourceName
- the resource nameaLocale
- the locale to consider, can benull
, for more details seeURIBuilderForResource
- Throws:
IllegalArgumentException
- if the providedResourceType
isnull
-
buildForResource
Builds aURI
for a the web resource specified by a node value.Calling this method is the same as calling
this.fromResource(aSchemaNode, aValue).build();
.- Parameters:
aSchemaNode
- the schema node where the value comes from. It must be anosd:resource
type.aValue
- the value of theosd:resource
type.- Throws:
IllegalArgumentException
- if the schema node or the value is not anosd:resource
type.- See Also:
-
fromResource
Creates a newUriBuilder
instance for the current module and a node value.Overriding already provided values is not supported and must be avoided. These values can be: the scheme, the host, the port, the root path or some query parameters.
- Parameters:
aSchemaNode
- the schema node where the value comes from. it must be anosd:resource
type.aValue
- the value of theosd:resource
type.- Throws:
IllegalArgumentException
- if the schema node or the value is not anosd:resource
type.
-