Project Wonder 5.0

er.rest.routes
Class ERXRouteRequestHandler.NameFormat

java.lang.Object
  extended by er.rest.routes.ERXRouteRequestHandler.NameFormat
Enclosing class:
ERXRouteRequestHandler

public static class ERXRouteRequestHandler.NameFormat
extends java.lang.Object

NameFormat specifies how routes and controller names should be capitalized by default.

Author:
mschrag

Nested Class Summary
static class ERXRouteRequestHandler.NameFormat.Case
          An enumerated type specifying the case of your routes.
 
Constructor Summary
ERXRouteRequestHandler.NameFormat(boolean pluralControllerName, boolean pluralRouteName, ERXRouteRequestHandler.NameFormat.Case routeCase)
          Creates a new NameFormat.
 
Method Summary
protected  java.lang.String caseifyEntityNamed(java.lang.String entityName)
          Applies the case transformation to the given string.
 java.lang.String formatEntityNamed(java.lang.String entityName, boolean pluralizeIfNecessary)
          Formats the given entity name based on the rules of this format.
 boolean pluralControllerName()
          Returns whether or not controller names should be pluralizd.
 boolean pluralRouteName()
          Returns whether or not routes should be pluralizd.
 ERXRouteRequestHandler.NameFormat.Case routeCase()
          Returns the case to use for routes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXRouteRequestHandler.NameFormat

public ERXRouteRequestHandler.NameFormat(boolean pluralControllerName,
                                         boolean pluralRouteName,
                                         ERXRouteRequestHandler.NameFormat.Case routeCase)
Creates a new NameFormat.

Parameters:
pluralControllerName - if true, controller names with be pluralized ("CompaniesController")
pluralRouteName - if true, routes will be pluralizd ("/Companies.xml")
routeCase - the case to use for the route name
Method Detail

pluralControllerName

public boolean pluralControllerName()
Returns whether or not controller names should be pluralizd.

Returns:
whether or not controller names should be pluralizd

pluralRouteName

public boolean pluralRouteName()
Returns whether or not routes should be pluralizd.

Returns:
whether or not routes should be pluralizd

routeCase

public ERXRouteRequestHandler.NameFormat.Case routeCase()
Returns the case to use for routes.

Returns:
whether or not routes should be capitalized

caseifyEntityNamed

protected java.lang.String caseifyEntityNamed(java.lang.String entityName)
Applies the case transformation to the given string.

Parameters:
entityName - the string to adjust the case of
Returns:
the case-adjusted string

formatEntityNamed

public java.lang.String formatEntityNamed(java.lang.String entityName,
                                          boolean pluralizeIfNecessary)
Formats the given entity name based on the rules of this format.

Parameters:
entityName - the entity name to format
pluralizeIfNecessary - if pluralRouteNames() is true, return the plural form
Returns:
the formatted entity name

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

Copyright © 2002 – 2007 Project Wonder.