Parsing

play.api.mvc.PathBindable.Parsing
class Parsing[A](parse: String => A, serialize: A => String, error: (String, Exception) => String) extends PathBindable[A]

A helper class for creating PathBindables to map the value of a path pattern/segment

Type parameters

A

the type being parsed

Value parameters

error

a function for rendering an error message if an error occurs

parse

a function to parse the path value

serialize

a function to serialize the path value to a string

Attributes

Graph
Supertypes
trait PathBindable[A]
class Object
trait Matchable
class Any
Known subtypes
object bindableFloat
object bindableInt
object bindableLong
object bindableShort
object bindableUUID
Show all

Members list

Value members

Concrete methods

def bind(key: String, value: String): Either[String, A]

Bind an URL path parameter.

Bind an URL path parameter.

Value parameters

key

Parameter key

value

The value as String (extracted from the URL path)

Attributes

Returns

Right of the value or Left of an error message if the binding failed

def unbind(key: String, value: A): String

Unbind a URL path parameter.

Unbind a URL path parameter.

Value parameters

key

Parameter key

value

Parameter value.

Attributes

Inherited methods

Javascript function to unbind in the Javascript router.

Javascript function to unbind in the Javascript router.

Attributes

Inherited from:
PathBindable
def transform[B](toB: A => B, toA: B => A): PathBindable[B]

Transform this PathBinding[A] to PathBinding[B]

Transform this PathBinding[A] to PathBinding[B]

Attributes

Inherited from:
PathBindable