Project Wonder 5.0

er.rest.routes
Class ERXRoute

java.lang.Object
  extended by er.rest.routes.ERXRoute

public class ERXRoute
extends java.lang.Object

ERXRoute encapsulates a URL path with matching values inside of it. For instance, the route "/company/{company:Company}/employees/{Person}/name/{name:String}" would yield an objects(..) dictionary with a Company EO mapped to the key "company," a Person EO mapped to the key "Person" and a String mapped to the key "name". ERXRoutes do not enforce any security -- they simply represent a way to map URL patterns onto objects.

Author:
mschrag

Nested Class Summary
static class ERXRoute.Key
          ERXRoute.Key encapsulates a key name and an expected value type.
static class ERXRoute.Method
           
static class ERXRoute.RouteParameterMethod
           
 
Field Summary
static ERXRoute.Key ActionKey
           
static ERXRoute.Key ControllerKey
           
 
Constructor Summary
ERXRoute(java.lang.String entityName, java.lang.String urlPattern)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, java.lang.Class<? extends ERXRouteController> controller)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, java.lang.Class<? extends ERXRouteController> controller, java.lang.String action)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, ERXRoute.Method method)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, ERXRoute.Method method, java.lang.Class<? extends ERXRouteController> controller)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, ERXRoute.Method method, java.lang.Class<? extends ERXRouteController> controller, java.lang.String action)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, ERXRoute.Method method, java.lang.String controller)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, ERXRoute.Method method, java.lang.String controller, java.lang.String action)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, java.lang.String controller)
          Constructs a new route with the given URL pattern.
ERXRoute(java.lang.String entityName, java.lang.String urlPattern, java.lang.String controller, java.lang.String action)
          Constructs a new route with the given URL pattern.
 
Method Summary
 void _clearCaches()
          Clears any caches that may exist on ERXRoutes (probably only useful to JRebel, to clear the route parameter method cache).
 java.lang.Class<? extends ERXRouteController> controller()
          Returns the controller class for this route.
 java.lang.String entityName()
          Returns the entity name of the target of this route (can be null).
 com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.String> keys(java.lang.String url, ERXRoute.Method method)
          Returns the route keys for the given URL.
static com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.Object> keysWithObjects(com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.String> keys, IERXRestDelegate delegate)
          Returns a dictionary mapping the route's keys to their resolved objects.
 com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.Object> keysWithObjects(java.lang.String url, ERXRoute.Method method, IERXRestDelegate delegate)
          Returns a dictionary mapping the route's keys to their resolved objects.
 ERXRoute.Method method()
          Returns the method of this request.
 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> objects(com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.String> keys, IERXRestDelegate delegate)
          Returns a dictionary mapping the route's key names to their resolved objects.
 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> objects(java.lang.String url, ERXRoute.Method method, IERXRestDelegate delegate)
          Returns a dictionary mapping the route's key names to their resolved objects.
 java.util.regex.Pattern routePattern()
          Returns the Pattern used to match this route.
 void setMethod(ERXRoute.Method method)
          Sets the method of this request.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ControllerKey

public static final ERXRoute.Key ControllerKey

ActionKey

public static final ERXRoute.Key ActionKey
Constructor Detail

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                ERXRoute.Method method)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                java.lang.String controller)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class name

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                ERXRoute.Method method,
                java.lang.String controller)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class name

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                java.lang.Class<? extends ERXRouteController> controller)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                ERXRoute.Method method,
                java.lang.Class<? extends ERXRouteController> controller)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                java.lang.String controller,
                java.lang.String action)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class name
action - the action name

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                ERXRoute.Method method,
                java.lang.String controller,
                java.lang.String action)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class name
action - the action name

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                java.lang.Class<? extends ERXRouteController> controller,
                java.lang.String action)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class
action - the action name

ERXRoute

public ERXRoute(java.lang.String entityName,
                java.lang.String urlPattern,
                ERXRoute.Method method,
                java.lang.Class<? extends ERXRouteController> controller,
                java.lang.String action)
Constructs a new route with the given URL pattern.

Parameters:
entityName - the name of the entity this route points to
urlPattern - the url pattern to use
controller - the default controller class
action - the action name
Method Detail

entityName

public java.lang.String entityName()
Returns the entity name of the target of this route (can be null).

Returns:
the entity name of the target of this route

controller

public java.lang.Class<? extends ERXRouteController> controller()
Returns the controller class for this route.

Returns:
the controller class for this route

routePattern

public java.util.regex.Pattern routePattern()
Returns the Pattern used to match this route.

Returns:
the Pattern used to match this route

method

public ERXRoute.Method method()
Returns the method of this request.

Returns:
the method of this request

setMethod

public void setMethod(ERXRoute.Method method)
Sets the method of this request.

Parameters:
method - the method of this request

_clearCaches

public void _clearCaches()
Clears any caches that may exist on ERXRoutes (probably only useful to JRebel, to clear the route parameter method cache).


keys

public com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.String> keys(java.lang.String url,
                                                                                  ERXRoute.Method method)
Returns the route keys for the given URL.

Parameters:
url - the URL to parse

keysWithObjects

public com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.Object> keysWithObjects(java.lang.String url,
                                                                                             ERXRoute.Method method,
                                                                                             IERXRestDelegate delegate)
Returns a dictionary mapping the route's keys to their resolved objects.

Parameters:
url - the URL to process
delegate - the delegate to use to, for instance, fault EO's with (or null to not fault EO's)
Returns:
a dictionary mapping the route's keys to their resolved objects

objects

public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> objects(java.lang.String url,
                                                                                         ERXRoute.Method method,
                                                                                         IERXRestDelegate delegate)
Returns a dictionary mapping the route's key names to their resolved objects.

Parameters:
url - the URL to process
delegate - the delegate to use to, for instance, fault EO's with (or null to not fault EO's)
Returns:
a dictionary mapping the route's key names to their resolved objects

keysWithObjects

public static com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.Object> keysWithObjects(com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.String> keys,
                                                                                                    IERXRestDelegate delegate)
Returns a dictionary mapping the route's keys to their resolved objects.

Parameters:
keys - the parsed keys to process
delegate - the delegate to use to, for instance, fault EO's with (or null to not fault EO's)
Returns:
a dictionary mapping the route's keys to their resolved objects

objects

public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> objects(com.webobjects.foundation.NSDictionary<ERXRoute.Key,java.lang.String> keys,
                                                                                         IERXRestDelegate delegate)
Returns a dictionary mapping the route's key names to their resolved objects.

Parameters:
keys - the parsed keys to process
delegate - the delegate to use to, for instance, fault EO's with (or null to not fault EO's)
Returns:
a dictionary mapping the route's key names to their resolved objects

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.