Class orion.URITemplate
A URITemplate describes a range of Uniform Resource Identifiers through variable expansion, and allows for particular URIs to be generated by expanding variables to actual values.
Because the syntax and encoding rules of URIs can be complex, URITemplates are recommended over manual construction of URIs through string concatenation or other means.
A URITemplate is created by invoking the constructor, passing a template string:
new URITemplate(template)
The template string is an expression following a well-defined syntax (see here for an introduction). Most notably, the template may include variables.
Once created, a URITemplate's #expand method can be invoked to generate a URI. Arguments to #expand give the values to be substituted for the template variables.
Defined in: </shared/eclipse/e4/orion/I201404012230/bundles/org.eclipse.orion.client.core/web/orion/URITemplate.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
orion.URITemplate(template)
Creates a new URITemplate.
|
Method Attributes | Method Name and Description |
---|---|
expand(params)
Expands this URITemplate to a URI.
|
- Parameters:
- {Object} params
- The parameters to use for expansion. This object is a map of keys (variable names) to values (the variable's value in the expansion algorithm).
- Returns:
- {String} The resulting URI.