ninja
Class Route

java.lang.Object
  extended by ninja.Route

public class Route
extends Object

A route


Constructor Summary
Route(String httpMethod, String uri, Class controllerClass, Method controllerMethod, FilterChain filterChain)
           
 
Method Summary
 Class getControllerClass()
           
 Method getControllerMethod()
           
 FilterChain getFilterChain()
           
 String getHttpMethod()
           
 Map<String,String> getPathParametersEncoded(String uri)
          This method does not do any decoding / encoding.
 String getUri()
           
 String getUrl()
           
 boolean matches(String httpMethod, String uri)
          Matches /index to /index or /me/1 to /person/{id}
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Route

public Route(String httpMethod,
             String uri,
             Class controllerClass,
             Method controllerMethod,
             FilterChain filterChain)
Method Detail

getUrl

public String getUrl()

getHttpMethod

public String getHttpMethod()

getUri

public String getUri()

getControllerClass

public Class getControllerClass()

getFilterChain

public FilterChain getFilterChain()

getControllerMethod

public Method getControllerMethod()

matches

public boolean matches(String httpMethod,
                       String uri)
Matches /index to /index or /me/1 to /person/{id}

Returns:
True if the actual route matches a raw rout. False if not.

getPathParametersEncoded

public Map<String,String> getPathParametersEncoded(String uri)
This method does not do any decoding / encoding. If you want to decode you have to do it yourself. Most likely with: http://docs.oracle.com/javase/6/docs/api/java/net/URI.html

Parameters:
uri - The whole encoded uri.
Returns:
A map with all parameters of that uri. Encoded in => encoded out.


Copyright © 2012. All Rights Reserved.