org.springframework.extensions.webscripts
Class UriTemplate

java.lang.Object
  extended by org.springframework.extensions.webscripts.UriTemplate

public class UriTemplate
extends Object

Class representing a Uri Template - with basic {token} format support. See JAX-RS JSR-311.

Author:
davidc

Constructor Summary
UriTemplate(String template)
          Construct
 
Method Summary
 boolean equals(Object obj)
           
 Pattern getRegex()
           
 int getStaticCharCount()
           
 String getTemplate()
           
 String[] getVariableNames()
           
 int hashCode()
           
 Map<String,String> match(String uri)
          Determine if uri is matched by this uri template and return a map of variable values if it does.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UriTemplate

public UriTemplate(String template)
Construct

Parameters:
template -
Method Detail

match

public Map<String,String> match(String uri)
Determine if uri is matched by this uri template and return a map of variable values if it does.

Parameters:
uri - uri to match
Returns:
map of variable values (or null, if no match, or empty if no vars)

getTemplate

public String getTemplate()
Returns:
get template

getRegex

public Pattern getRegex()
Returns:
get regular expression equivalent

getVariableNames

public String[] getVariableNames()
Returns:
get variable names contained in uri template

getStaticCharCount

public int getStaticCharCount()
Returns:
get number of static characters in uri template

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2009 SpringSource, Inc. All Rights Reserved.