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
  )
)
Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. data
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class Field(form: 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]] = immutable.this.Nil)(implicit 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] = immutable.this.Nil) 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]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

    Represents an object binding (ie.

  8. case class ObjectMapping10[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  9. case class ObjectMapping11[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  10. case class ObjectMapping12[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  11. case class ObjectMapping13[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  12. case class ObjectMapping14[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), f14: (String, Mapping[A14]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  13. case class ObjectMapping15[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), f14: (String, Mapping[A14]), f15: (String, Mapping[A15]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  14. case class ObjectMapping16[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), f14: (String, Mapping[A14]), f15: (String, Mapping[A15]), f16: (String, Mapping[A16]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  15. case class ObjectMapping17[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), f14: (String, Mapping[A14]), f15: (String, Mapping[A15]), f16: (String, Mapping[A16]), f17: (String, Mapping[A17]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  16. case class ObjectMapping18[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), f10: (String, Mapping[A10]), f11: (String, Mapping[A11]), f12: (String, Mapping[A12]), f13: (String, Mapping[A13]), f14: (String, Mapping[A14]), f15: (String, Mapping[A15]), f16: (String, Mapping[A16]), f17: (String, Mapping[A17]), f18: (String, Mapping[A18]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  17. case class ObjectMapping2[R, A1, A2](apply: (A1, A2) ⇒ R, unapply: (R) ⇒ Option[(A1, A2)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  18. case class ObjectMapping3[R, A1, A2, A3](apply: (A1, A2, A3) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  19. case class ObjectMapping4[R, A1, A2, A3, A4](apply: (A1, A2, A3, A4) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  20. case class ObjectMapping5[R, A1, A2, A3, A4, A5](apply: (A1, A2, A3, A4, A5) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  21. case class ObjectMapping6[R, A1, A2, A3, A4, A5, A6](apply: (A1, A2, A3, A4, A5, A6) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  22. case class ObjectMapping7[R, A1, A2, A3, A4, A5, A6, A7](apply: (A1, A2, A3, A4, A5, A6, A7) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  23. case class ObjectMapping8[R, A1, A2, A3, A4, A5, A6, A7, A8](apply: (A1, A2, A3, A4, A5, A6, A7, A8) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  24. case class ObjectMapping9[R, A1, A2, A3, A4, A5, A6, A7, A8, A9](apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9) ⇒ R, unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9)], f1: (String, Mapping[A1]), f2: (String, Mapping[A2]), f3: (String, Mapping[A3]), f4: (String, Mapping[A4]), f5: (String, Mapping[A5]), f6: (String, Mapping[A6]), f7: (String, Mapping[A7]), f8: (String, Mapping[A8]), f9: (String, Mapping[A9]), key: String = "", constraints: Seq[Constraint[R]] = immutable.this.Nil) extends Mapping[R] with ObjectMapping with Product with Serializable

  25. case class OptionalMapping[T](wrapped: Mapping[T], constraints: Seq[Constraint[Option[T]]] = immutable.this.Nil) extends Mapping[Option[T]] with Product with Serializable

    A mapping for optional elements

  26. case class RepeatedMapping[T](wrapped: Mapping[T], key: String = "", constraints: Seq[Constraint[List[T]]] = immutable.this.Nil) extends Mapping[List[T]] with Product with Serializable

    A mapping for repeated elements.

  27. case class WrappedMapping[A, B](wrapped: Mapping[A], f1: (A) ⇒ B, f2: (B) ⇒ A, additionalConstraints: Seq[Constraint[B]] = immutable.this.Nil) 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

    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.

Inherited from AnyRef

Inherited from Any

Ungrouped