com.atlassian.gadgets.util
Class UriTemplate
java.lang.Object
com.atlassian.gadgets.util.UriTemplate
public class UriTemplate
- extends Object
Used to match and extract parameter values from request URIs against a URI template. A URI template is a regular
URI, but with "templates" where where parameter values should be. As an example
/dashboards/{dashboardId}/gadgets/{gadgetId} is a URI template with 2 parameters,
dashboardId and gadgetId.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UriTemplate
public UriTemplate(String uriTemplate)
matches
public boolean matches(String uri)
- Returns
true if the URI matches this template, false.
- Parameters:
uri - URI to check against the template
- Returns:
true if the URI matches this template, false otherwise.
extractParameters
public Map<String,String> extractParameters(String uri)
- Returns
Map of parameter names and their values.
- Parameters:
uri - URI which matches this template
- Returns:
Map of parameter names and their values
- Throws:
IllegalArgumentException - if uri does not match this template
Copyright © 2010 Atlassian. All Rights Reserved.