public final class URITemplate extends Object
URITemplateParser| Constructor and Description |
|---|
URITemplate(String input)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
expand(Map<String,VariableValue> vars)
Deprecated.
use
toString(VariableMap) instead. Will be removed
in version 0.6. |
String |
toString(VariableMap vars)
Expand this template to a string given a list of variables
|
URI |
toURI(VariableMap vars)
Expand this template to a URI given a set of variables
|
URL |
toURL(VariableMap vars)
Expand this template to a URL given a set of variables
|
public URITemplate(String input) throws URITemplateParseException
input - the input stringURITemplateParseException - parse error@Deprecated public String expand(Map<String,VariableValue> vars) throws URITemplateException
toString(VariableMap) instead. Will be removed
in version 0.6.Note that this only returns a string. It is up to the caller to verify afterwards that the resulting string is actually a valid URI. The RFC makes no guarantee about that!
vars - the variable map (names as keys, contents as values)URITemplateException - expansion error (f.e. modifier mismatch)public String toString(VariableMap vars) throws URITemplateException
vars - the variable map (names as keys, contents as values)URITemplateException - expansion error (f.e. modifier mismatch)public URI toURI(VariableMap vars) throws URITemplateException, URISyntaxException
vars - the variablesURITemplateException - see toString(VariableMap)URISyntaxException - expanded string is not a valid URIpublic URL toURL(VariableMap vars) throws URITemplateException, MalformedURLException
vars - the variablesURITemplateException - see toString(VariableMap)MalformedURLException - expanded string is not a valid URLCopyright © 2013. All Rights Reserved.