public class UriTemplate
extends java.lang.Object
Constructor and Description |
---|
UriTemplate() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
expand(java.lang.String pathUri,
java.lang.Object parameters,
boolean addUnusedParamsAsQueryParams)
Expands templates in a URI.
|
static java.lang.String |
expand(java.lang.String baseUrl,
java.lang.String uriTemplate,
java.lang.Object parameters,
boolean addUnusedParamsAsQueryParams)
Expands templates in a URI template that is relative to a base URL.
|
public static java.lang.String expand(java.lang.String baseUrl, java.lang.String uriTemplate, java.lang.Object parameters, boolean addUnusedParamsAsQueryParams)
If the URI template starts with a "/" the raw path from the base URL is stripped out. If the URI template is a full URL then it is used instead of the base URL.
Supports Level 1 templates and all Level 4 composite templates as described in: RFC 6570.
baseUrl
- The base URL which the URI component is relative to.uriTemplate
- URI component. It may contain one or more sequences of the form "{name}",
where "name" must be a key in variableMap.parameters
- an object with parameters designated by Key annotations. If the template has
no variable references, parameters may be null
.addUnusedParamsAsQueryParams
- If true then parameters that do not match the template are
appended to the expanded template as query parameters.public static java.lang.String expand(java.lang.String pathUri, java.lang.Object parameters, boolean addUnusedParamsAsQueryParams)
Supports Level 1 templates and all Level 4 composite templates as described in: RFC 6570.
pathUri
- URI component. It may contain one or more sequences of the form "{name}", where
"name" must be a key in variableMapparameters
- an object with parameters designated by Key annotations. If the template has
no variable references, parameters may be null
.addUnusedParamsAsQueryParams
- If true then parameters that do not match the template are
appended to the expanded template as query parameters.Copyright © 2011-2018 Google. All Rights Reserved.