com.scooterframework.web.route
Class Route

java.lang.Object
  extended by com.scooterframework.web.route.Route
Direct Known Subclasses:
RegularRoute

public abstract class Route
extends java.lang.Object

Route class


Field Summary
protected  java.lang.String action
           
protected  java.lang.String allowed_formats
           
protected  java.lang.String allowed_methods
           
protected  java.lang.String controller
           
protected  java.lang.String controllerClass
           
protected  boolean dynamicAction
           
protected  boolean dynamicController
           
protected  boolean dynamicFormat
           
protected  java.lang.String format
           
protected  java.lang.String id
           
protected  java.lang.String name
           
protected  java.lang.String namespace
           
protected  java.lang.String pathPrefix
           
protected  java.lang.String requirements
           
protected  java.lang.String singular
           
protected  java.lang.String urlPattern
           
 
Constructor Summary
protected Route()
           
  Route(java.lang.String name, java.util.Properties p)
           
 
Method Summary
 java.lang.String[] allowedFormats()
           
 java.lang.String[] allowedMethods()
           
 void copy(Route route)
           
 java.lang.String getAction()
           
 java.lang.String getAllowedFormats()
           
 java.lang.String getAllowedMethods()
           
 java.lang.String getController()
           
 java.lang.String getControllerClass()
           
protected  java.lang.String getControllerClassName(java.lang.String controller)
           
 java.lang.String getFormat()
           
 java.lang.String getId()
           
protected  java.lang.String getModel(java.lang.String controller)
           
 java.lang.String getModelClassName(java.lang.String controller)
           
 java.lang.String getName()
           
 java.lang.String getNamespace()
           
 java.lang.String getPathPrefix()
           
 java.lang.String[] getPathSegments()
           
 java.util.Map<java.lang.String,java.lang.Integer> getRequiredFieldPositions()
           
 java.lang.String getRequirements()
           
 RouteInfo getRouteInfo(RequestInfo requestInfo)
           
abstract  java.lang.String getRouteType()
           
 java.lang.String getScreenURL(java.util.Map<java.lang.String,java.lang.String> fieldValues)
           
protected  java.lang.String getScreenURLPattern()
          Returns screen URL which is a combination of path_prefix and url.
 java.lang.String getSingular()
           
 java.lang.String getURLPattern()
           
 java.lang.String getURLSegment(java.lang.String key, java.lang.String path)
           
 java.lang.String getViewPath(java.lang.String controller)
          Path to the view file
 boolean hasFormat()
           
protected  boolean isAllowedFieldValue(RequestInfo requestInfo)
           
protected  boolean isAllowedFormat(java.lang.String fmat)
           
protected  boolean isAllowedMethod(java.lang.String method)
           
protected abstract  boolean isRouteFor(RequestInfo requestInfo)
           
protected  void parsePath(java.lang.String path)
           
protected  void populateProperties(java.util.Properties p)
           
protected  void populateRequiredFields()
           
 int segmentCount()
           
 java.lang.String toString()
          Returns a string representation of the object.
static void validateMethods(java.lang.String httpMethods)
           
protected  void validation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

urlPattern

protected java.lang.String urlPattern

controller

protected java.lang.String controller

controllerClass

protected java.lang.String controllerClass

action

protected java.lang.String action

id

protected java.lang.String id

format

protected java.lang.String format

allowed_formats

protected java.lang.String allowed_formats

allowed_methods

protected java.lang.String allowed_methods

singular

protected java.lang.String singular

namespace

protected java.lang.String namespace

pathPrefix

protected java.lang.String pathPrefix

requirements

protected java.lang.String requirements

dynamicController

protected boolean dynamicController

dynamicAction

protected boolean dynamicAction

dynamicFormat

protected boolean dynamicFormat
Constructor Detail

Route

protected Route()

Route

public Route(java.lang.String name,
             java.util.Properties p)
Method Detail

getRouteType

public abstract java.lang.String getRouteType()

isRouteFor

protected abstract boolean isRouteFor(RequestInfo requestInfo)

getRouteInfo

public RouteInfo getRouteInfo(RequestInfo requestInfo)

getName

public java.lang.String getName()

getURLPattern

public java.lang.String getURLPattern()

getController

public java.lang.String getController()

getControllerClass

public java.lang.String getControllerClass()

getControllerClassName

protected java.lang.String getControllerClassName(java.lang.String controller)

getAction

public java.lang.String getAction()

getId

public java.lang.String getId()

getFormat

public java.lang.String getFormat()

hasFormat

public boolean hasFormat()

getAllowedFormats

public java.lang.String getAllowedFormats()

allowedFormats

public java.lang.String[] allowedFormats()

isAllowedFormat

protected boolean isAllowedFormat(java.lang.String fmat)

getAllowedMethods

public java.lang.String getAllowedMethods()

allowedMethods

public java.lang.String[] allowedMethods()

validateMethods

public static void validateMethods(java.lang.String httpMethods)

isAllowedMethod

protected boolean isAllowedMethod(java.lang.String method)

getSingular

public java.lang.String getSingular()

getModel

protected java.lang.String getModel(java.lang.String controller)

getModelClassName

public java.lang.String getModelClassName(java.lang.String controller)

getNamespace

public java.lang.String getNamespace()

getPathPrefix

public java.lang.String getPathPrefix()

getRequirements

public java.lang.String getRequirements()

getScreenURLPattern

protected java.lang.String getScreenURLPattern()
Returns screen URL which is a combination of path_prefix and url.


getScreenURL

public java.lang.String getScreenURL(java.util.Map<java.lang.String,java.lang.String> fieldValues)

getViewPath

public java.lang.String getViewPath(java.lang.String controller)
Path to the view file


getPathSegments

public java.lang.String[] getPathSegments()

segmentCount

public int segmentCount()

getRequiredFieldPositions

public java.util.Map<java.lang.String,java.lang.Integer> getRequiredFieldPositions()

isAllowedFieldValue

protected boolean isAllowedFieldValue(RequestInfo requestInfo)

getURLSegment

public java.lang.String getURLSegment(java.lang.String key,
                                      java.lang.String path)

copy

public void copy(Route route)

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
String

populateProperties

protected void populateProperties(java.util.Properties p)

parsePath

protected void parsePath(java.lang.String path)

populateRequiredFields

protected void populateRequiredFields()

validation

protected void validation()