play.api

data

package data

Contains data manipulation helpers (typically HTTP form handling)

import play.api.data._
import play.api.data.Forms._

val taskForm = Form(
  tuple(
    "name" -> text(minLength = 3),
    "dueDate" -> date("yyyy-MM-dd"),
    "done" -> boolean
  )
)
Visibility
  1. Public
  2. All

Type Members

  1. case class Field (form: play.api.data.Form[_], name: String, constraints: Seq[(String, Seq[Any])], format: Option[(String, Seq[Any])], errors: Seq[FormError], value: Option[String]) extends Product with Serializable

    A form field.

  2. case class FieldMapping [T] (key: String, constraints: Seq[Constraint[T]], binder: Formatter[T]) extends Mapping[T] with Product with Serializable

    A mapping for a single field.

  3. case class Form [T] (mapping: Mapping[T], data: Map[String, String], errors: Seq[FormError], value: Option[T]) extends Product with Serializable

    Helper to manage HTML form description, submission and validation.

  4. case class FormError (key: String, message: String, args: Seq[Any]) extends Product with Serializable

    A form error.

  5. trait Mapping [T] extends AnyRef

    A mapping is a two-way binder to handle a form field.

  6. trait ObjectMapping extends AnyRef

    Common helper methods for all object mappings - mappings including several fields.

  7. case class ObjectMapping1 [R, A1] (apply: (A1) ⇒ R, unapply: (R) ⇒ Option[A1], f1: (String, Mapping[A1]), key: String, constraints: Seq[Constraint[R]]) extends Mapping[R] with ObjectMapping with Product with Serializable

    Represents an object binding (ie.

  8. case class OptionalMapping [T] (wrapped: Mapping[T], constraints: Seq[Constraint[Option[T]]]) extends Mapping[Option[T]] with Product with Serializable

    A mapping for optional elements

  9. case class RepeatedMapping [T] (wrapped: Mapping[T], key: String, constraints: Seq[Constraint[List[T]]]) extends Mapping[List[T]] with Product with Serializable

    A mapping for repeated elements.

  10. case class WrappedMapping [A, B] (wrapped: Mapping[A], f1: (A) ⇒ B, f2: (B) ⇒ A, additionalConstraints: Seq[Constraint[B]]) extends Mapping[B] with Product with Serializable

    A mapping wrapping another existing mapping with transformation functions.

Value Members

  1. object Form extends Serializable

    Provides a set of operations for creating Form values.

  2. object Forms extends AnyRef

    Contains data manipulation helpers (typically HTTP form handling)

  3. object RepeatedMapping extends Serializable

    Provides a set of operations related to RepeatedMapping values.

  4. package format

    Contains the Format API used by Form.

  5. package validation

    Contains the validation API used by Form.