play.api.data

validation

package validation

Contains the validation API used by Form.

For example, to define a custom constraint:

  val negative = Constraint[Int] {
    case i if i < 0 => Valid
    case _ => Invalid("Must be a negative number.")
  }
Visibility
  1. Public
  2. All

Type Members

  1. case class Constraint [-T] (name: Option[String], args: Seq[Any], f: (T) ⇒ ValidationResult) extends Product with Serializable

    A form constraint.

  2. trait Constraints extends AnyRef

    Defines a set of built-in constraints.

  3. case class Invalid (errors: Seq[ValidationError]) extends ValidationResult with Product with Serializable

    Validation was a failure.

  4. case class ValidationError (message: String, args: Any*) extends Product with Serializable

    A validation error.

  5. trait ValidationResult extends AnyRef

    A validation result.

Value Members

  1. object Constraint extends Serializable

    This object provides helpers for creating Constraint values.

  2. object Constraints extends Constraints

    Defines a set of built-in constraints.

  3. object Invalid extends Serializable

    This object provides helper methods to construct Invalid values.

  4. object Valid extends ValidationResult with Product with Serializable

    Validation was a success.