c

org.coursera.naptime.router2

NaptimePlayRouter

case class NaptimePlayRouter(naptimeRoutes: NaptimeRoutes, prefix: String) extends play.api.routing.Router with StrictLogging with Product with Serializable

Handles routing for Naptime resources in an idiomatic fashion for Play projects.

To use this router, include in your routes file something like:

# Include Naptime resources
->    /api                  org.coursera.naptime.router2.PlayNaptimeRouter

Requests matching the prefix for naptime resources will then be routed appropriately.

naptimeRoutes

Collects the common data structures useful for request routing, including the router builders, as well as the routers themselves.

prefix

The prefix path under which the resources should be served (in the example above: /api).

Annotations
@Singleton()
Linear Supertypes
Serializable, Serializable, Product, Equals, StrictLogging, play.api.routing.Router, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NaptimePlayRouter
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. StrictLogging
  7. Router
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NaptimePlayRouter(naptimeRoutes: NaptimeRoutes)
    Annotations
    @Inject()
  2. new NaptimePlayRouter(naptimeRoutes: NaptimeRoutes, prefix: String)

    naptimeRoutes

    Collects the common data structures useful for request routing, including the router builders, as well as the routers themselves.

    prefix

    The prefix path under which the resources should be served (in the example above: /api).

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: play.routing.Router
    Definition Classes
    Router
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. lazy val documentation: Seq[(String, String, String)]

    Includes the Naptime resources into Play's dev mode not-found handler that lists all routes.

    Includes the Naptime resources into Play's dev mode not-found handler that lists all routes.

    Definition Classes
    NaptimePlayRouter → Router
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def handlerFor(request: RequestHeader): Option[Handler]

    Route the request to one of the naptime resources, invoking the (macro-generated) router.

    Route the request to one of the naptime resources, invoking the (macro-generated) router.

    request

    The request to route.

    returns

    If this is a naptime request for one of the routers, return the handler, otherwise None

    Definition Classes
    NaptimePlayRouter → Router
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val logger: Logger
    Attributes
    protected
    Definition Classes
    StrictLogging
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. lazy val routes: Routes

    Defer to handlerFor instead of the other way around for performance reasons.

    Defer to handlerFor instead of the other way around for performance reasons.

    It is better to have the true implementation in handlerFor where we can route a request once than to implement the partial function here, and have handlerFor call isDefinedAt and then apply, which would result in request routing and URL parsing occuring twice for a single request when it wouldn't need to.

    Definition Classes
    NaptimePlayRouter → Router
  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  22. def withPrefix(prefix: String): play.api.routing.Router
    Definition Classes
    NaptimePlayRouter → Router

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from StrictLogging

Inherited from play.api.routing.Router

Inherited from AnyRef

Inherited from Any

Ungrouped