Top Description Inners Fields Constructors Methods
org.glassfish.tyrus.core.uri.internal

public Class UriTemplate

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.tyrus.core.uri.internal.PathTemplate
Imports
java.net.URI, java.util.ArrayDeque, .Collections, .Comparator, .Deque, .HashMap, .List, .Map, java.util.regex.Matcher, .Pattern, .PatternSyntaxException

A URI template.
Authors
Paul Sandoz, Martin Matula, Gerard Davison (gerard.davison at oracle.com)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
UriTemplate.TemplateValueStrategy

A strategy interface for processing parameters, should be replaced with a JDK 8 one day in the future.

Field Summary

Modifier and TypeField and Description
public static final Comparator<UriTemplate>
COMPARATOR

Order the templates according to JAX-RS specification.

public static final UriTemplate
EMPTY

The empty URI template that matches the null or empty URI path.

private static final String[]
private final boolean
endsWithSlash

True if the URI template ends in a '/' character.

private final String
normalizedTemplate

The normalized URI template.

private final int
numOfCharacters

The number of characters in the regular expression not resulting from conversion of template variables.

private final int
numOfExplicitRegexes

The number of explicit regular expressions declared for template variables.

private final int
numOfRegexGroups

The number of regular expression groups in this pattern.

private final PatternWithGroups
pattern

The pattern generated from the template.

private final String
template

The URI template.

private static final Pattern
TEMPLATE_NAMES_PATTERN

The regular expression for matching URI templates and names.

private final List<String>
templateVariables

The template variables in the URI template.

Constructor Summary

AccessConstructor and Description
private
UriTemplate()

Constructor for NULL template.

public
UriTemplate(String
the template.
template
)

Construct a new URI template.

protected
UriTemplate(UriTemplateParser
the parser to parse the template.
templateParser
)

Construct a new URI template.

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

the URI.
createURI
(final Map<String, String>
the map of template variables to template values.
values
)

Create a URI by substituting any template variables for corresponding template values.

public final String

Returns:

the URI.
createURI
(String...
the array of template values. The values will be substituted in order of occurrence of unique template variables.
values
)

Create a URI by substituting any template variables for corresponding template values.

public final String

Returns:

the URI.
createURI
(final String[]
the array of template values. The values will be substituted in order of occurrence of unique template variables.
values
,
final int
the offset into the template value array.
offset
,
final int
the length of the template value array.
length
)

Create a URI by substituting any template variables for corresponding template values.

public static String

Returns:

a URI.
createURI
(final String
the URI scheme component.
scheme
,
String
the URI authority component.
authority
,
final String
the URI user info component.
userInfo
,
final String
the URI host component.
host
,
final String
the URI port component.
port
,
final String
the URI path component.
path
,
final String
the URI query component.
query
,
final String
the URI fragment component.
fragment
,
final Map<String, ?>
the template variable to value map.
values
,
final boolean
if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.
encode
,
final boolean
if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.
encodeSlashInPath
)

Construct a URI from the component parts each of which may contain template variables.

public static String

Returns:

a URI.
createURI
(final String
the URI scheme component.
scheme
,
String
the URI authority component.
authority
,
final String
the URI user info component.
userInfo
,
final String
the URI host component.
host
,
final String
the URI port component.
port
,
final String
the URI path component.
path
,
final String
the URI query component.
query
,
final String
] the URI fragment component.
fragment
,
final Object[]
the array of template values.
values
,
final boolean
if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.
encode
,
final boolean
if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.
encodeSlashInPath
)

Construct a URI from the component parts each of which may contain template variables.

private static int
createUriComponent(final UriComponent.Type componentType, String template, final String[] values, final int valueOffset, final boolean encode, final Map<String, ?> _mapValues, final StringBuilder b)

public static String

Returns:

a URI.
createURIWithStringValues
(final String
the URI scheme component.
scheme
,
final String
the URI authority info component.
authority
,
final String
the URI user info component.
userInfo
,
final String
the URI host component.
host
,
final String
the URI port component.
port
,
final String
the URI path component.
path
,
final String
the URI query component.
query
,
final String
the URI fragment component.
fragment
,
final Map<String, ?>
the template variable to value map.
values
,
final boolean
if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.
encode
,
final boolean
if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.
encodeSlashInPath
)

Construct a URI from the component parts each of which may contain template variables.

public static String

Returns:

a URI.
createURIWithStringValues
(final String
the URI scheme component.
scheme
,
final String
the URI authority component.
authority
,
final String
the URI user info component.
userInfo
,
final String
the URI host component.
host
,
final String
the URI port component.
port
,
final String
the URI path component.
path
,
final String
the URI query component.
query
,
final String
the URI fragment component.
fragment
,
final String[]
the array of template values.
values
,
final boolean
if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.
encode
,
final boolean
if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.
encodeSlashInPath
)

Construct a URI from the component parts each of which may contain template variables.

private static String
createURIWithStringValues(final String scheme, final String authority, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final String[] values, final boolean encode, final boolean encodeSlashInPath, final Map<String, ?> mapValues)

public final boolean

Returns:

true if the template ends in a '/', otherwise false.
endsWithSlash
()

Check if the URI template ends in a slash ('/').

public final boolean

Returns:

true if equals, otherwise false.
equals
(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Equality is calculated from the String of the regular expression generated from the templates.

public final int

Returns:

the number of explicit characters
getNumberOfExplicitCharacters
()

Get the number of characters in the regular expression not resulting from conversion of template variables.

public final int

Returns:

the number of explicit regular expressions in the template variables.
getNumberOfExplicitRegexes
()

Get the number of explicit regular expressions declared in the template variables.

public final int

Returns:

the number of regular expressions groups
getNumberOfRegexGroups
()

Get the number of regular expression groups

public final int

Returns:

the number of template variables.
getNumberOfTemplateVariables
()

Get the number of template variables.

public final PatternWithGroups

Returns:

the URI pattern.
getPattern
()

Get the URI pattern.

public final String

Returns:

the URI template.
getTemplate
()

Get the URI template as a String.

public final List<String>

Returns:

the list of template variables.
getTemplateVariables
()

Get the list of template variables for the template.

public final int

Returns:

the hash code.
hashCode
()

Overrides java.lang.Object.hashCode.

Hash code is calculated from String of the regular expression generated from the template.

private static PatternWithGroups

Returns:

the URI pattern.
initUriPattern
(UriTemplateParser
the URI template parser.
templateParser
)

Create the URI pattern from a URI template parser.

public final boolean

Returns:

true if the template variable is a member of the template, otherwise false.
isTemplateVariablePresent
(String
name The template variable.
name
)

Ascertain if a template variable is a member of this template.

public final boolean

Returns:

true if the URI matches the template, otherwise false.
match
(CharSequence
the uri to match against the template.
uri
,
Map<String, String>
the map where to put template variables (as keys) and template values (as values). The map is cleared before any entries are put.
templateVariableToValue
)

Match a URI against the template.

public final boolean

Returns:

true if the URI matches the template, otherwise false.
match
(CharSequence
the uri to match against the template.
uri
,
List<String>
the list to store the values of a pattern's capturing groups is matching is successful. The values are stored in the same order as the pattern's capturing groups.
groupValues
)

Match a URI against the template.

public static URI

Returns:

the URI with dot and dot-dot segments resolved.
normalize
(final String
the original URI string.
uri
)

Normalize the URI by resolve the dot & dot-dot path segments as described in RFC 3986.

public static URI

Returns:

the URI with dot and dot-dot segments resolved.
normalize
(final URI
the original URI.
uri
)

Normalize the URI by resolve the dot & dot-dot path segments as described in RFC 3986.

private static boolean
notEmpty(String string)

public static URI

Returns:

relativized URI.
relativize
(URI
base URI to be used for relativization.
baseUri
,
URI
URI to be relativized.
refUri
)

Relativize URI with respect to a base URI.

public static URI

Returns:

resolved URI.
resolve
(final URI
base URI to be used for resolution.
baseUri
,
String
reference URI string to be resolved against the base URI.
refUri
)

Resolve a relative URI reference against a base URI as defined in RFC 3986.

public static URI

Returns:

resolved URI.
resolve
(final URI
base URI to be used for resolution.
baseUri
,
URI
reference URI to be resolved against the base URI.
refUri
)

Resolve a relative URI reference against a base URI as defined in RFC 3986.

private static void
resolveTemplate(String
normalized URI template. A normalized template is a template without any explicit regular expressions.
normalizedTemplate
,
StringBuilder
URI string builder to be used.
builder
,
UriTemplate.TemplateValueStrategy
The template value producer strategy to use.
valueStrategy
)

Build a URI based on the parameters provided by the variable name strategy.

public static String

Returns:

String with resolved template variables.
resolveTemplateValues
(final UriComponent.Type
Type of the template (port, path, query, ...).
type
,
String
Input uri component to resolve.
template
,
final boolean
True if template values from _mapValues should be percent encoded.
encode
,
final Map<String, ?>
Map with template variables as keys and template values as values. None of them should be null.
_mapValues
)

Resolves template variables in the given template from _mapValues.

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

COMPARATORback to summary
public static final Comparator<UriTemplate> COMPARATOR

Order the templates according to JAX-RS specification.

Sort the set of matching resource classes using the number of characters in the regular expression not resulting from template variables as the primary key, the number of matching groups as a secondary key, and the number of explicit regular expression declarations as the tertiary key.

EMPTYback to summary
public static final UriTemplate EMPTY

The empty URI template that matches the null or empty URI path.

EMPTY_VALUESback to summary
private static final String[] EMPTY_VALUES
endsWithSlashback to summary
private final boolean endsWithSlash

True if the URI template ends in a '/' character.

normalizedTemplateback to summary
private final String normalizedTemplate

The normalized URI template. Any explicit regex are removed to leave the template variables.

numOfCharactersback to summary
private final int numOfCharacters

The number of characters in the regular expression not resulting from conversion of template variables.

numOfExplicitRegexesback to summary
private final int numOfExplicitRegexes

The number of explicit regular expressions declared for template variables.

numOfRegexGroupsback to summary
private final int numOfRegexGroups

The number of regular expression groups in this pattern.

patternback to summary
private final PatternWithGroups pattern

The pattern generated from the template.

templateback to summary
private final String template

The URI template.

TEMPLATE_NAMES_PATTERNback to summary
private static final Pattern TEMPLATE_NAMES_PATTERN

The regular expression for matching URI templates and names.

templateVariablesback to summary
private final List<String> templateVariables

The template variables in the URI template.

Constructor Detail

UriTemplateback to summary
private UriTemplate()

Constructor for NULL template.

UriTemplateback to summary
public UriTemplate(String template) throws PatternSyntaxException, IllegalArgumentException

Construct a new URI template.

The template will be parsed to extract template variables.

A specific regular expression will be generated from the template to match URIs according to the template and map template variables to template values.

Parameters
template:String

the template.

Annotations
@SuppressWarnings:DuplicateThrows
Exceptions
PatternSyntaxException:
if the specified regular expression could not be generated
IllegalArgumentException:
if the template is null or an empty string.
UriTemplateback to summary
protected UriTemplate(UriTemplateParser templateParser) throws PatternSyntaxException, IllegalArgumentException

Construct a new URI template.

The template will be parsed to extract template variables.

A specific regular expression will be generated from the template to match URIs according to the template and map template variables to template values.

Parameters
templateParser:UriTemplateParser

the parser to parse the template.

Annotations
@SuppressWarnings:DuplicateThrows
Exceptions
PatternSyntaxException:
if the specified regular expression could not be generated
IllegalArgumentException:
if the template is null or an empty string.

Method Detail

createURIback to summary
public final String createURI(final Map<String, String> values)

Create a URI by substituting any template variables for corresponding template values.

A URI template variable without a value will be substituted by the empty string.

Parameters
values:Map<String, String>

the map of template variables to template values.

Returns:String

the URI.

createURIback to summary
public final String createURI(String... values)

Create a URI by substituting any template variables for corresponding template values.

A URI template variable without a value will be substituted by the empty string.

Parameters
values:String[]

the array of template values. The values will be substituted in order of occurrence of unique template variables.

Returns:String

the URI.

createURIback to summary
public final String createURI(final String[] values, final int offset, final int length)

Create a URI by substituting any template variables for corresponding template values.

A URI template variable without a value will be substituted by the empty string.

Parameters
values:String[]

the array of template values. The values will be substituted in order of occurrence of unique template variables.

offset:int

the offset into the template value array.

length:int

the length of the template value array.

Returns:String

the URI.

createURIback to summary
public static String createURI(final String scheme, String authority, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Map<String, ?> values, final boolean encode, final boolean encodeSlashInPath)

Construct a URI from the component parts each of which may contain template variables.

A template values is an Object instance MUST support the toString() method to convert the template value to a String instance.

Parameters
scheme:String

the URI scheme component.

authority:String

the URI authority component.

userInfo:String

the URI user info component.

host:String

the URI host component.

port:String

the URI port component.

path:String

the URI path component.

query:String

the URI query component.

fragment:String

the URI fragment component.

values:Map<String, ?>

the template variable to value map.

encode:boolean

if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.

encodeSlashInPath:boolean

if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.

Returns:String

a URI.

createURIback to summary
public static String createURI(final String scheme, String authority, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Object[] values, final boolean encode, final boolean encodeSlashInPath)

Construct a URI from the component parts each of which may contain template variables.

The template values are an array of Object and each Object instance MUST support the toString() method to convert the template value to a String instance.

Parameters
scheme:String

the URI scheme component.

authority:String

the URI authority component.

userInfo:String

the URI user info component.

host:String

the URI host component.

port:String

the URI port component.

path:String

the URI path component.

query:String

the URI query component.

fragment:String

] the URI fragment component.

values:Object[]

the array of template values.

encode:boolean

if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.

encodeSlashInPath:boolean

if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.

Returns:String

a URI.

createUriComponentback to summary
private static int createUriComponent(final UriComponent.Type componentType, String template, final String[] values, final int valueOffset, final boolean encode, final Map<String, ?> _mapValues, final StringBuilder b)
Annotations
@SuppressWarnings:unchecked
createURIWithStringValuesback to summary
public static String createURIWithStringValues(final String scheme, final String authority, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Map<String, ?> values, final boolean encode, final boolean encodeSlashInPath)

Construct a URI from the component parts each of which may contain template variables.

A template value is an Object instance that MUST support the toString() method to convert the template value to a String instance.

Parameters
scheme:String

the URI scheme component.

authority:String

the URI authority info component.

userInfo:String

the URI user info component.

host:String

the URI host component.

port:String

the URI port component.

path:String

the URI path component.

query:String

the URI query component.

fragment:String

the URI fragment component.

values:Map<String, ?>

the template variable to value map.

encode:boolean

if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.

encodeSlashInPath:boolean

if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.

Returns:String

a URI.

createURIWithStringValuesback to summary
public static String createURIWithStringValues(final String scheme, final String authority, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final String[] values, final boolean encode, final boolean encodeSlashInPath)

Construct a URI from the component parts each of which may contain template variables.

Parameters
scheme:String

the URI scheme component.

authority:String

the URI authority component.

userInfo:String

the URI user info component.

host:String

the URI host component.

port:String

the URI port component.

path:String

the URI path component.

query:String

the URI query component.

fragment:String

the URI fragment component.

values:String[]

the array of template values.

encode:boolean

if true encode a template value according to the correspond component type of the associated template variable, otherwise contextually encode the template value.

encodeSlashInPath:boolean

if true, the slash ('/') characters in parameter values will be encoded if the template is placed in the URI path component, otherwise the slash characters will not be encoded in path templates.

Returns:String

a URI.

createURIWithStringValuesback to summary
private static String createURIWithStringValues(final String scheme, final String authority, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final String[] values, final boolean encode, final boolean encodeSlashInPath, final Map<String, ?> mapValues)
endsWithSlashback to summary
public final boolean endsWithSlash()

Check if the URI template ends in a slash ('/').

Returns:boolean

true if the template ends in a '/', otherwise false.

Annotations
@SuppressWarnings:UnusedDeclaration
equalsback to summary
public final boolean equals(Object o)

Overrides java.lang.Object.equals.

Equality is calculated from the String of the regular expression generated from the templates.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if equals, otherwise false.

Annotations
@Override
getNumberOfExplicitCharactersback to summary
public final int getNumberOfExplicitCharacters()

Get the number of characters in the regular expression not resulting from conversion of template variables.

Returns:int

the number of explicit characters

getNumberOfExplicitRegexesback to summary
public final int getNumberOfExplicitRegexes()

Get the number of explicit regular expressions declared in the template variables.

Returns:int

the number of explicit regular expressions in the template variables.

getNumberOfRegexGroupsback to summary
public final int getNumberOfRegexGroups()

Get the number of regular expression groups

Returns:int

the number of regular expressions groups

getNumberOfTemplateVariablesback to summary
public final int getNumberOfTemplateVariables()

Get the number of template variables.

Returns:int

the number of template variables.

getPatternback to summary
public final PatternWithGroups getPattern()

Get the URI pattern.

Returns:PatternWithGroups

the URI pattern.

getTemplateback to summary
public final String getTemplate()

Get the URI template as a String.

Returns:String

the URI template.

getTemplateVariablesback to summary
public final List<String> getTemplateVariables()

Get the list of template variables for the template.

Returns:List<String>

the list of template variables.

hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Hash code is calculated from String of the regular expression generated from the template.

Returns:int

the hash code.

Annotations
@Override
initUriPatternback to summary
private static PatternWithGroups initUriPattern(UriTemplateParser templateParser)

Create the URI pattern from a URI template parser.

Parameters
templateParser:UriTemplateParser

the URI template parser.

Returns:PatternWithGroups

the URI pattern.

isTemplateVariablePresentback to summary
public final boolean isTemplateVariablePresent(String name)

Ascertain if a template variable is a member of this template.

Parameters
name:String

name The template variable.

Returns:boolean

true if the template variable is a member of the template, otherwise false.

Annotations
@SuppressWarnings:UnusedDeclaration
matchback to summary
public final boolean match(CharSequence uri, Map<String, String> templateVariableToValue) throws IllegalArgumentException

Match a URI against the template.

If the URI matches against the pattern then the template variable to value map will be filled with template variables as keys and template values as values.

Parameters
uri:CharSequence

the uri to match against the template.

templateVariableToValue:Map<String, String>

the map where to put template variables (as keys) and template values (as values). The map is cleared before any entries are put.

Returns:boolean

true if the URI matches the template, otherwise false.

Exceptions
IllegalArgumentException:
if the uri or templateVariableToValue is null.
matchback to summary
public final boolean match(CharSequence uri, List<String> groupValues) throws IllegalArgumentException

Match a URI against the template.

If the URI matches against the pattern the capturing group values (if any) will be added to a list passed in as parameter.

Parameters
uri:CharSequence

the uri to match against the template.

groupValues:List<String>

the list to store the values of a pattern's capturing groups is matching is successful. The values are stored in the same order as the pattern's capturing groups.

Returns:boolean

true if the URI matches the template, otherwise false.

Exceptions
IllegalArgumentException:
if the uri or templateVariableToValue is null.
normalizeback to summary
public static URI normalize(final String uri)

Normalize the URI by resolve the dot & dot-dot path segments as described in RFC 3986.

This method provides a workaround for issues with java.net.URI#normalize() which is not able to properly normalize absolute paths that start with a ".." segment, e.g. "/../a/b" as required by RFC 3986 (according to RFC 3986 the path "/../a/b" should resolve to "/a/b", while URI.normalize() keeps the ".." segment in the URI path.

Parameters
uri:String

the original URI string.

Returns:URI

the URI with dot and dot-dot segments resolved.

Exceptions
IllegalArgumentException:
If the given string violates the URI specification RFC.
See Also
java.net.URI#normalize()
normalizeback to summary
public static URI normalize(final URI uri)

Normalize the URI by resolve the dot & dot-dot path segments as described in RFC 3986.

This method provides a workaround for issues with java.net.URI#normalize() which is not able to properly normalize absolute paths that start with a ".." segment, e.g. "/../a/b" as required by RFC 3986 (according to RFC 3986 the path "/../a/b" should resolve to "/a/b", while URI.normalize() keeps the ".." segment in the URI path.

Parameters
uri:URI

the original URI.

Returns:URI

the URI with dot and dot-dot segments resolved.

See Also
java.net.URI#normalize()
notEmptyback to summary
private static boolean notEmpty(String string)
relativizeback to summary
public static URI relativize(URI baseUri, URI refUri)

Relativize URI with respect to a base URI.

After the relativization is done, dots in paths of both URIs are resolved.

Parameters
baseUri:URI

base URI to be used for relativization.

refUri:URI

URI to be relativized.

Returns:URI

relativized URI.

resolveback to summary
public static URI resolve(final URI baseUri, String refUri)

Resolve a relative URI reference against a base URI as defined in RFC 3986.

Parameters
baseUri:URI

base URI to be used for resolution.

refUri:String

reference URI string to be resolved against the base URI.

Returns:URI

resolved URI.

Exceptions
IllegalArgumentException:
If the given string violates the URI specification RFC.
resolveback to summary
public static URI resolve(final URI baseUri, URI refUri)

Resolve a relative URI reference against a base URI as defined in RFC 3986.

Parameters
baseUri:URI

base URI to be used for resolution.

refUri:URI

reference URI to be resolved against the base URI.

Returns:URI

resolved URI.

resolveTemplateback to summary
private static void resolveTemplate(String normalizedTemplate, StringBuilder builder, UriTemplate.TemplateValueStrategy valueStrategy)

Build a URI based on the parameters provided by the variable name strategy.

Parameters
normalizedTemplate:String

normalized URI template. A normalized template is a template without any explicit regular expressions.

builder:StringBuilder

URI string builder to be used.

valueStrategy:UriTemplate.TemplateValueStrategy

The template value producer strategy to use.

resolveTemplateValuesback to summary
public static String resolveTemplateValues(final UriComponent.Type type, String template, final boolean encode, final Map<String, ?> _mapValues)

Resolves template variables in the given template from _mapValues. Resolves only these variables which are defined in the _mapValues leaving other variables unchanged.

Parameters
type:UriComponent.Type

Type of the template (port, path, query, ...).

template:String

Input uri component to resolve.

encode:boolean

True if template values from _mapValues should be percent encoded.

_mapValues:Map<String, ?>

Map with template variables as keys and template values as values. None of them should be null.

Returns:String

String with resolved template variables.

Annotations
@SuppressWarnings:unchecked
Exceptions
IllegalArgumentException:
when _mapValues value is null.
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.glassfish.tyrus.core.uri.internal back to summary

private Interface UriTemplate.TemplateValueStrategy


A strategy interface for processing parameters, should be replaced with a JDK 8 one day in the future.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

template value.
valueFor
(String
template variable.
templateVariable
,
String
matched group string for a given template variable.
matchedGroup
)

Get a value for a given template variable.

Method Detail

valueForback to summary
public String valueFor(String templateVariable, String matchedGroup)

Get a value for a given template variable.

Parameters
templateVariable:String

template variable.

matchedGroup:String

matched group string for a given template variable.

Returns:String

template value.

Exceptions
IllegalArgumentException:
in case no value has been found and the strategy does not support null values.