net.metanotion.urlmapper
Class URITemplate

java.lang.Object
  extended by net.metanotion.urlmapper.URITemplate

public final class URITemplate
extends Object


Constructor Summary
URITemplate(String template)
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 String toString()
          Return the URITemplate represented by this object.
 String toString(Map<String,Object> params)
          Expand a URI Template into a URI(in string form).
 URI toURI(Map<String,Object> params)
          Expand a URI Template into a URI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URITemplate

public URITemplate(String template)
            throws ParseException
Throws:
ParseException
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Return the URITemplate represented by this object. The value returned here should follow the identity law: o.equals(new URITemplate(o.toString())) == true

Overrides:
toString in class Object
Returns:
The string representing this URI Template.

toString

public String toString(Map<String,Object> params)
Expand a URI Template into a URI(in string form).

Parameters:
params - Key/value pairs to use for template Expansions.
Returns:
The URI(as a String) created by replacing the expansions with their values.

toURI

public URI toURI(Map<String,Object> params)
          throws URISyntaxException
Expand a URI Template into a URI

Parameters:
params - Key/value pairs to use for template Expansions.
Returns:
The URI created by replacing the expansions with their values.
Throws:
URISyntaxException