object Forms
Contains data manipulation helpers (typically HTTP form handling)
import play.api.data._ import play.api.data.Forms._ val taskForm = Form( of(Task.apply _, Task.unapply _)( "name" -> text(minLength = 3), "dueDate" -> date("yyyy-MM-dd"), "done" -> boolean ) )
- Source
- Forms.scala
- Alphabetic
- By Inheritance
- Forms
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bigDecimal(precision: Int, scale: Int): Mapping[BigDecimal]
Constructs a mapping for a BigDecimal field.
Constructs a mapping for a BigDecimal field.
For example:
Form("montant" -> bigDecimal(10, 2))
- precision
The maximum total number of digits (including decimals)
- scale
The maximum number of decimals
-
val
bigDecimal: Mapping[BigDecimal]
Constructs a simple mapping for a BigDecimal field.
Constructs a simple mapping for a BigDecimal field.
For example:
Form("montant" -> bigDecimal)
-
val
boolean: Mapping[Boolean]
Constructs a simple mapping for a Boolean field, such as a check-box.
Constructs a simple mapping for a Boolean field, such as a check-box.
For example:
Form("accepted" -> boolean)
-
def
byteNumber(min: Byte = Byte.MinValue, max: Byte = Byte.MaxValue, strict: Boolean = false): Mapping[Byte]
Constructs a simple mapping for a numeric field (using a Short type behind).
Constructs a simple mapping for a numeric field (using a Short type behind).
For example:
Form("size" -> byteNumber(min=0, max=100))
- min
minimum value
- max
maximum value
- strict
should it be a strict comparison
-
val
byteNumber: Mapping[Byte]
Constructs a simple mapping for a numeric field (using a Byte type behind).
Constructs a simple mapping for a numeric field (using a Byte type behind).
For example:
Form("size" -> byteNumber)
-
val
char: Mapping[Char]
Constructs a simple mapping for a char field.
Constructs a simple mapping for a char field.
For example:
Form("gender" -> char)
- def checked(msg: String): Mapping[Boolean]
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
date(pattern: String, timeZone: TimeZone = java.util.TimeZone.getDefault): Mapping[Date]
Constructs a simple mapping for a date field.
Constructs a simple mapping for a date field.
For example:
Form("birthdate" -> date("dd-MM-yyyy"))
- pattern
the date pattern, as defined in
java.text.SimpleDateFormat
- timeZone
the
java.util.TimeZone
to use for parsing and formatting
-
val
date: Mapping[Date]
Constructs a simple mapping for a date field.
Constructs a simple mapping for a date field.
For example:
Form("birthdate" -> date)
-
def
default[A](mapping: Mapping[A], value: A): Mapping[A]
Defines an default mapping, if the parameter is not present, provide a default value.
Defines an default mapping, if the parameter is not present, provide a default value.
Form( "name" -> default(text, "The default text") )
- mapping
The mapping to make optional.
- value
The default value when mapping and the field is not present.
-
val
email: Mapping[String]
Constructs a simple mapping for an e-mail field.
Constructs a simple mapping for an e-mail field.
- See also
http://www.w3.org/TR/html5/forms.html#e-mail-state-(type=email) For example:
Form("email" -> email)
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
ignored[A](value: A): Mapping[A]
Define a fixed value in a mapping.
Define a fixed value in a mapping. This mapping will not participate to the binding.
- value
As we ignore this parameter in binding/unbinding we have to provide a default value.
-
def
indexedSeq[A](mapping: Mapping[A]): Mapping[IndexedSeq[A]]
Defines a repeated mapping with the IndexedSeq semantic.
Defines a repeated mapping with the IndexedSeq semantic.
Form( "name" -> indexedSeq(text) )
- mapping
The mapping to make repeated.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
list[A](mapping: Mapping[A]): Mapping[List[A]]
Defines a repeated mapping.
Defines a repeated mapping.
Form( "name" -> list(text) )
- mapping
The mapping to make repeated.
-
def
localDate(pattern: String): Mapping[LocalDate]
Constructs a simple mapping for a date field (mapped as
java.time.LocalDate type
).Constructs a simple mapping for a date field (mapped as
java.time.LocalDate type
).For example:
Form("birthdate" -> localDate("dd-MM-yyyy"))
- pattern
the date pattern, as defined in
java.time.format.DateTimeFormatter
-
val
localDate: Mapping[LocalDate]
Constructs a simple mapping for a date field (mapped as
java.time.LocalDate type
).Constructs a simple mapping for a date field (mapped as
java.time.LocalDate type
).For example:
Form("birthdate" -> localDate)
-
def
localDateTime(pattern: String): Mapping[LocalDateTime]
Constructs a simple mapping for a date field (mapped as
java.time.LocalDateTime type
).Constructs a simple mapping for a date field (mapped as
java.time.LocalDateTime type
).For example:
Form("dateTime" -> localDateTime("dd-MM-yyyy HH:mm:ss"))
- pattern
the date pattern, as defined in
java.time.format.DateTimeFormatter
-
val
localDateTime: Mapping[LocalDateTime]
Constructs a simple mapping for a date field (mapped as
java.time.LocalDateTime type
).Constructs a simple mapping for a date field (mapped as
java.time.LocalDateTime type
).For example:
Form("dateTime" -> localDateTime)
-
def
localTime(pattern: String): Mapping[LocalTime]
Constructs a simple mapping for a date field (mapped as
java.time.LocalTime type
).Constructs a simple mapping for a date field (mapped as
java.time.LocalTime type
).For example:
Form("time" -> localTime("HH:mm:ss"))
- pattern
the date pattern, as defined in
java.time.format.DateTimeFormatter
-
val
localTime: Mapping[LocalTime]
Constructs a simple mapping for a date field (mapped as
java.time.LocalTime type
).Constructs a simple mapping for a date field (mapped as
java.time.LocalTime type
).For example:
Form("time" -> localTime)
-
def
longNumber(min: Long = Long.MinValue, max: Long = Long.MaxValue, strict: Boolean = false): Mapping[Long]
Constructs a simple mapping for a numeric field (using a Long type behind).
Constructs a simple mapping for a numeric field (using a Long type behind).
For example:
Form("size" -> longNumber(min=0, max=100))
- min
minimum value
- max
maximum value
- strict
should it be a strict comparison
-
val
longNumber: Mapping[Long]
Constructs a simple mapping for a numeric field (using a Long type behind).
Constructs a simple mapping for a numeric field (using a Long type behind).
For example:
Form("size" -> longNumber)
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]), a20: (String, Mapping[A20]), a21: (String, Mapping[A21]), a22: (String, Mapping[A22]))(apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]), a20: (String, Mapping[A20]), a21: (String, Mapping[A21]))(apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]), a20: (String, Mapping[A20]))(apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]))(apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[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)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8, A9](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]))(apply: (A1, A2, A3, A4, A5, A6, A7, A8, A9) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8, A9)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7, A8](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]))(apply: (A1, A2, A3, A4, A5, A6, A7, A8) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7, A8)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6, A7](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]))(apply: (A1, A2, A3, A4, A5, A6, A7) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6, A7)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5, A6](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]))(apply: (A1, A2, A3, A4, A5, A6) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5, A6)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4, A5](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]))(apply: (A1, A2, A3, A4, A5) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4, A5)]): Mapping[R]
- def mapping[R, A1, A2, A3, A4](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]))(apply: (A1, A2, A3, A4) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3, A4)]): Mapping[R]
- def mapping[R, A1, A2, A3](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]))(apply: (A1, A2, A3) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2, A3)]): Mapping[R]
- def mapping[R, A1, A2](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]))(apply: (A1, A2) ⇒ R)(unapply: (R) ⇒ Option[(A1, A2)]): Mapping[R]
-
def
mapping[R, A1](a1: (String, Mapping[A1]))(apply: (A1) ⇒ R)(unapply: (R) ⇒ Option[A1]): Mapping[R]
Creates a Mapping of type
T
.Creates a Mapping of type
T
.For example:
Form( mapping( "email" -> of[String] )(User.apply, User.unapply) )
- R
the mapped type
- apply
A function able to create a value of R from a value of A1 (If R is case class you can use its own apply function)
- unapply
A function able to create A1 from a value of R (If R is a case class you can use its own unapply function)
- returns
a mapping for type
R
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nonEmptyText(minLength: Int = 0, maxLength: Int = Int.MaxValue): Mapping[String]
Constructs a simple mapping for required text field.
Constructs a simple mapping for required text field.
Example:
Form("username" -> nonEmptyText(minLength=3))
- minLength
Text min length.
- maxLength
Text max length.
-
val
nonEmptyText: Mapping[String]
Constructs a simple mapping for required text field.
Constructs a simple mapping for required text field.
Note that all field are always required to be present in the form unless there are marked as optional explicitly. But a nonEmptyText defines text field that must not be empty, even if present in the form.
Example:
Form("username" -> nonEmptyText)
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
number(min: Int = Int.MinValue, max: Int = Int.MaxValue, strict: Boolean = false): Mapping[Int]
Constructs a simple mapping for a numeric field.
Constructs a simple mapping for a numeric field.
For example:
Form("size" -> number(min=0, max=100))
- min
minimum value
- max
maximum value
- strict
should it be a strict comparison
-
val
number: Mapping[Int]
Constructs a simple mapping for a numeric field.
Constructs a simple mapping for a numeric field.
For example:
Form("size" -> number)
-
def
of[T](implicit binder: Formatter[T]): FieldMapping[T]
Creates a Mapping of type
T
.Creates a Mapping of type
T
.For example:
Form("email" -> of[String])
- T
the mapping type
- returns
a mapping for a simple field
-
def
optional[A](mapping: Mapping[A]): Mapping[Option[A]]
Defines an optional mapping.
Defines an optional mapping.
Form( "name" -> optional(text) )
- mapping
The mapping to make optional.
-
def
seq[A](mapping: Mapping[A]): Mapping[Seq[A]]
Defines a repeated mapping.
Defines a repeated mapping.
Form( "name" -> seq(text) )
- mapping
The mapping to make repeated.
-
def
set[A](mapping: Mapping[A]): Mapping[Set[A]]
Defines a repeated mapping with the Set semantic.
Defines a repeated mapping with the Set semantic.
Form( "name" -> set(text) )
- mapping
The mapping to make repeated.
-
def
shortNumber(min: Short = Short.MinValue, max: Short = Short.MaxValue, strict: Boolean = false): Mapping[Short]
Constructs a simple mapping for a numeric field (using a Short type behind).
Constructs a simple mapping for a numeric field (using a Short type behind).
For example:
Form("size" -> shortNumber(min=0, max=100))
- min
minimum value
- max
maximum value
- strict
should it be a strict comparison
-
val
shortNumber: Mapping[Short]
Constructs a simple mapping for a numeric field (using a Short type behind).
Constructs a simple mapping for a numeric field (using a Short type behind).
For example:
Form("size" -> shortNumber)
-
def
single[A1](a1: (String, Mapping[A1])): Mapping[A1]
Creates a Mapping for a single value.
Creates a Mapping for a single value.
For example:
Form( single( "email" -> email ) )
- returns
a mapping for a type A1
-
def
sqlDate(pattern: String): Mapping[Date]
Constructs a simple mapping for a date field (mapped as
sql.Date type
).Constructs a simple mapping for a date field (mapped as
sql.Date type
).For example:
Form("birthdate" -> sqlDate("dd-MM-yyyy"))
- pattern
the date pattern, as defined in
java.text.SimpleDateFormat
-
val
sqlDate: Mapping[Date]
Constructs a simple mapping for a date field (mapped as
sql.Date type
).Constructs a simple mapping for a date field (mapped as
sql.Date type
).For example:
Form("birthdate" -> sqlDate)
-
def
sqlTimestamp(pattern: String, timeZone: TimeZone = java.util.TimeZone.getDefault): Mapping[Timestamp]
Constructs a simple mapping for a Timestamp field (mapped as
java.sql.Timestamp type
).Constructs a simple mapping for a Timestamp field (mapped as
java.sql.Timestamp type
).For example:
Form("birthdate" -> sqlTimestamp("dd-MM-yyyy hh:mm:ss"))
- pattern
the date pattern, as defined in
java.text.SimpleDateFormat
- timeZone
the
java.util.TimeZone
to use for parsing and formatting
-
val
sqlTimestamp: Mapping[Timestamp]
Constructs a simple mapping for a timestamp field (mapped as
java.sql.Timestamp type
).Constructs a simple mapping for a timestamp field (mapped as
java.sql.Timestamp type
).For example:
Form("birthdate" -> sqlTimestamp)
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
text(minLength: Int = 0, maxLength: Int = Int.MaxValue): Mapping[String]
Constructs a simple mapping for a text field.
Constructs a simple mapping for a text field.
For example:
Form("username" -> text(minLength=3))
- minLength
minimum text length
- maxLength
maximum text length
-
val
text: Mapping[String]
Constructs a simple mapping for a text field.
Constructs a simple mapping for a text field.
For example:
Form("username" -> text)
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]), a20: (String, Mapping[A20]), a21: (String, Mapping[A21]), a22: (String, Mapping[A22])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]), a20: (String, Mapping[A20]), a21: (String, Mapping[A21])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19]), a20: (String, Mapping[A20])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18]), a19: (String, Mapping[A19])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17]), a18: (String, Mapping[A18])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16]), a17: (String, Mapping[A17])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15]), a16: (String, Mapping[A16])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14]), a15: (String, Mapping[A15])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13]), a14: (String, Mapping[A14])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12]), a13: (String, Mapping[A13])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11]), a12: (String, Mapping[A12])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10]), a11: (String, Mapping[A11])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9]), a10: (String, Mapping[A10])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8, A9](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8]), a9: (String, Mapping[A9])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8, A9)]
- def tuple[A1, A2, A3, A4, A5, A6, A7, A8](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7]), a8: (String, Mapping[A8])): Mapping[(A1, A2, A3, A4, A5, A6, A7, A8)]
- def tuple[A1, A2, A3, A4, A5, A6, A7](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6]), a7: (String, Mapping[A7])): Mapping[(A1, A2, A3, A4, A5, A6, A7)]
- def tuple[A1, A2, A3, A4, A5, A6](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5]), a6: (String, Mapping[A6])): Mapping[(A1, A2, A3, A4, A5, A6)]
- def tuple[A1, A2, A3, A4, A5](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4]), a5: (String, Mapping[A5])): Mapping[(A1, A2, A3, A4, A5)]
- def tuple[A1, A2, A3, A4](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3]), a4: (String, Mapping[A4])): Mapping[(A1, A2, A3, A4)]
- def tuple[A1, A2, A3](a1: (String, Mapping[A1]), a2: (String, Mapping[A2]), a3: (String, Mapping[A3])): Mapping[(A1, A2, A3)]
-
def
tuple[A1, A2](a1: (String, Mapping[A1]), a2: (String, Mapping[A2])): Mapping[(A1, A2)]
Creates a Mapping of tuple
(A,B)
.Creates a Mapping of tuple
(A,B)
.For example:
Form( tuple( "email" -> email, "password" -> nonEmptyText ) )
- returns
a mapping for a tuple
(A,B)
-
val
uuid: Mapping[UUID]
Constructs a simple mapping for a UUID field.
Constructs a simple mapping for a UUID field.
For example:
Form("id" -> uuid)
-
def
vector[A](mapping: Mapping[A]): Mapping[Vector[A]]
Defines a repeated mapping with the Vector semantic.
Defines a repeated mapping with the Vector semantic.
Form( "name" -> vector(text) )
- mapping
The mapping to make repeated.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )