com.scooterframework.web.route
Class MatchMaker

java.lang.Object
  extended by com.scooterframework.web.route.MatchMaker

public class MatchMaker
extends java.lang.Object

MatchMaker class


Method Summary
 void addDefaultRoute(DefaultRoute route)
           
 void addDefaultRoutes(java.util.List<DefaultRoute> routes)
           
 void addNamedRoute(NamedRoute route)
           
 void addNamedRoutes(java.util.List<NamedRoute> routes)
           
 void addRegularRoute(RegularRoute route)
           
 void addRegularRoutes(java.util.List<RegularRoute> routes)
           
 void addResource(java.lang.String resourceName, Resource resource)
           
 void addRestRoute(RestRoute route)
           
 void addRestRoutes(java.util.List<RestRoute> routes)
           
 void clear()
           
 int countRoutes()
           
 java.util.List<Route> getAllRoutes()
           
 DefaultRoute getDefaultRoute(java.lang.String routeName)
           
static MatchMaker getInstance()
           
 NamedRoute getNamedRoute(java.lang.String routeName)
           
 RegularRoute getRegularRoute(java.lang.String routeName)
           
 Resource getResource(java.lang.String resourceName)
          Returns resource corresponding to a resource name.
 Resource getResourceForModel(java.lang.String model)
          Returns resource corresponding to a model name.
 java.util.Map<java.lang.String,Resource> getResourceMap()
           
 RestRoute getRestRoute(java.lang.String routeName)
           
 RootRoute getRootRoute()
           
 RootRoute getRootRoute(java.lang.String routeName)
           
 Route getRoute(java.lang.String routeName)
           
 boolean isAddedResource(java.lang.String resourceName)
          Checks if a resource name is already added as a resource.
 RouteInfo match(RequestInfo requestInfo)
           
 void setRootRoute(RootRoute route)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MatchMaker getInstance()

getAllRoutes

public java.util.List<Route> getAllRoutes()

countRoutes

public int countRoutes()

getRoute

public Route getRoute(java.lang.String routeName)

getRootRoute

public RootRoute getRootRoute()

getRootRoute

public RootRoute getRootRoute(java.lang.String routeName)

setRootRoute

public void setRootRoute(RootRoute route)

getDefaultRoute

public DefaultRoute getDefaultRoute(java.lang.String routeName)

addDefaultRoute

public void addDefaultRoute(DefaultRoute route)

addDefaultRoutes

public void addDefaultRoutes(java.util.List<DefaultRoute> routes)

getNamedRoute

public NamedRoute getNamedRoute(java.lang.String routeName)

addNamedRoute

public void addNamedRoute(NamedRoute route)

addNamedRoutes

public void addNamedRoutes(java.util.List<NamedRoute> routes)

getRegularRoute

public RegularRoute getRegularRoute(java.lang.String routeName)

addRegularRoute

public void addRegularRoute(RegularRoute route)

addRegularRoutes

public void addRegularRoutes(java.util.List<RegularRoute> routes)

getRestRoute

public RestRoute getRestRoute(java.lang.String routeName)

addRestRoute

public void addRestRoute(RestRoute route)

addRestRoutes

public void addRestRoutes(java.util.List<RestRoute> routes)

getResourceMap

public java.util.Map<java.lang.String,Resource> getResourceMap()

isAddedResource

public boolean isAddedResource(java.lang.String resourceName)
Checks if a resource name is already added as a resource.

Parameters:
resourceName -
Returns:
true if the resourceName is not a resource already added.

getResource

public Resource getResource(java.lang.String resourceName)
Returns resource corresponding to a resource name.

Parameters:
resourceName - resource name
Returns:
resource

getResourceForModel

public Resource getResourceForModel(java.lang.String model)
Returns resource corresponding to a model name.

Parameters:
model - model name
Returns:
resource

addResource

public void addResource(java.lang.String resourceName,
                        Resource resource)

clear

public void clear()

match

public RouteInfo match(RequestInfo requestInfo)