com.khubla.pragmatach.framework.router
Class PragmatachRoute

java.lang.Object
  extended by com.khubla.pragmatach.framework.router.PragmatachRoute
All Implemented Interfaces:
Comparable<PragmatachRoute>

public class PragmatachRoute
extends Object
implements Comparable<PragmatachRoute>

a specific route

Author:
tome

Constructor Summary
PragmatachRoute(Method method)
          ctor
 
Method Summary
 int compareTo(PragmatachRoute pragmatachRoute)
           
protected  View findView()
          find the view declaration for the route
 Set<Method> getAfterMethods()
           
 Set<Method> getBeforeMethods()
           
 List<RouteParameter> getBoundRouteParameters()
          get bound parameters annotations, in order of the parameters in the method
 PragmatachController getControllerClazzInstance(Request request)
          get a class instance of the controller, and return a proxy that allows us to intercept method calls
 String getDescription()
           
 Method getMethod()
           
 int getParameterCount()
          number of method parameters
 Route getRoute()
           
 RouteSpecification getRouteSpecification()
           
 int getSegmentCount()
          number of route segments
 View getView()
           
 boolean isWildcardRoute()
           
 boolean scopes(PragmatachRoute pragmatachRoute)
          returns true this route is more general than the passed route, false otherwise
static boolean scopes(String uri1, String uri2)
          check if uri1 scopes uri2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PragmatachRoute

public PragmatachRoute(Method method)
                throws PragmatachException
ctor

Throws:
PragmatachException
Method Detail

scopes

public static boolean scopes(String uri1,
                             String uri2)
check if uri1 scopes uri2. That is, uri1 is more general than uri2.


compareTo

public int compareTo(PragmatachRoute pragmatachRoute)
Specified by:
compareTo in interface Comparable<PragmatachRoute>

findView

protected View findView()
                 throws PragmatachException
find the view declaration for the route

Firstly, look for an annotation on the method, then the class.

Throws:
PragmatachException

getAfterMethods

public Set<Method> getAfterMethods()

getBeforeMethods

public Set<Method> getBeforeMethods()

getBoundRouteParameters

public List<RouteParameter> getBoundRouteParameters()
get bound parameters annotations, in order of the parameters in the method


getControllerClazzInstance

public PragmatachController getControllerClazzInstance(Request request)
                                                throws PragmatachException
get a class instance of the controller, and return a proxy that allows us to intercept method calls

Throws:
PragmatachException

getDescription

public String getDescription()

getMethod

public Method getMethod()

getParameterCount

public int getParameterCount()
number of method parameters


getRoute

public Route getRoute()

getRouteSpecification

public RouteSpecification getRouteSpecification()

getSegmentCount

public int getSegmentCount()
number of route segments


getView

public View getView()

isWildcardRoute

public boolean isWildcardRoute()

scopes

public boolean scopes(PragmatachRoute pragmatachRoute)
returns true this route is more general than the passed route, false otherwise



Copyright © 2014 khubla.com. All rights reserved.