|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.module.apikit.uri.URITemplate
public class URITemplate
A URI Template for constructing URIs following the same structure.
Instances of this class implement the URI templates as defined by the URI Template (Draft 3) by Joe Gregorio. A URI Template follows the URI syntax and can be expanded given a set of variable values.
| Constructor Summary | |
|---|---|
URITemplate(String template)
Creates a new URI Template instance. |
|
URITemplate(String template,
TokenFactory factory)
Creates a new URI Template instance using the specified token factory. |
|
| Method Summary | |
|---|---|
static List<Token> |
digest(String template)
Returns the list of tokens corresponding to the specified URI template. |
static List<Token> |
digest(String template,
TokenFactory factory)
Returns the list of tokens corresponding to the specified URI template. |
boolean |
equals(Object o)
|
String |
expand(Parameters parameters)
Expands the template to produce a URI as defined by the URI Template specifications. |
static String |
expand(String template,
Parameters parameters)
Method provided for convenience. |
int |
hashCode()
|
protected List<Token> |
tokens()
Returns the underlying list of tokens. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public URITemplate(String template)
throws IllegalArgumentException
template - A String following the URI template syntax.
NullPointerException - If the specified template is null.
URITemplateSyntaxException - If the string provided does not follow the proper syntax.
IllegalArgumentException
public URITemplate(String template,
TokenFactory factory)
throws IllegalArgumentException
If the specified factory is null, the default is used.
template - A String following the URI template syntax.factory - A token factory in order to choose the URI template syntax to use.
NullPointerException - If the specified template is null.
URITemplateSyntaxException - If the string provided does not follow the proper syntax.
IllegalArgumentException| Method Detail |
|---|
public String expand(Parameters parameters)
expand in interface Expandableparameters - The list of variables and their values for substitution.
public static String expand(String template,
Parameters parameters)
return new URITemplate(template).expand(variables);
template - The URI template.parameters - The parameter values to use for substitution.
public static List<Token> digest(String template)
throws URITemplateSyntaxException
template - The URI template to digest.
URITemplateSyntaxException - If the string cannot be parsed.
public static List<Token> digest(String template,
TokenFactory factory)
throws URITemplateSyntaxException
template - The URI template to digest.
URITemplateSyntaxException - If the string cannot be parsed.protected List<Token> tokens()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||