Class

org.coursera.naptime.router2

NaptimePlayRouter

Related Doc: package router2

Permalink

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)

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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. lazy val documentation: Seq[(String, String, String)]

    Permalink

    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
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def handlerFor(request: RequestHeader): Option[Handler]

    Permalink

    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
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. lazy val routes: Routes

    Permalink

    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
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def withPrefix(prefix: String): play.api.routing.Router

    Permalink
    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