Packages

  • package root
    Definition Classes
    root
  • package play

    Play framework.

    Play framework.

    Play

    http://www.playframework.com

    Definition Classes
    root
  • package api

    Contains the public API for Scala developers.

    Contains the public API for Scala developers.

    Read configuration
    val poolSize = configuration.getInt("engine.pool.size")
    Use the logger
    Logger.info("Hello!")
    Define a Plugin
    class MyPlugin(app: Application) extends Plugin
    Create adhoc applications (for testing)
    val application = Application(new File("."), this.getClass.getClassloader, None, Play.Mode.DEV)
    Definition Classes
    play
  • package libs

    Contains various APIs that are useful while developing web applications.

    Contains various APIs that are useful while developing web applications.

    Definition Classes
    api
  • package json

    Json API

    Json API

    For example:

    import play.api.libs.json._
    import play.api.libs.functional.syntax._
    
    case class User(id: Long, name: String, friends: Seq[User] = Seq.empty)
    object User {
    
      // In this format, an undefined friends property is mapped to an empty list
      implicit val format: Format[User] = (
        (__ \ "id").format[Long] and
        (__ \ "name").format[String] and
        (__ \ "friends").lazyFormatNullable(implicitly[Format[Seq[User]]])
          .inmap[Seq[User]](_ getOrElse Seq.empty, Some(_))
      )(User.apply, unlift(User.unapply))
    }
    
    object MyController extends play.api.mvc.Controller {
       def displayUserAsJson(id: String) = Action {
          Ok(Json.toJson(User(id.toLong, "myName")))
       }
    
       def saveUser(jsonString: String)= Action {
         val user = Json.parse(jsonString).as[User]
         //myDataStore.save(user)
         Ok
       }
    }
    Definition Classes
    libs
  • trait DefaultWrites extends LowPriorityWrites

    Default Serializers.

    Default Serializers.

    Definition Classes
    json
  • BigDecimalWrites
  • BigIntWrites
  • BigIntegerWrites
  • BooleanWrites
  • ByteWrites
  • DefaultDateWrites
  • DefaultJodaDateWrites
  • DefaultJodaLocalDateWrites
  • DefaultJodaLocalTimeWrites
  • DoubleWrites
  • FloatWrites
  • IntWrites
  • JsValueWrites
  • JsonNodeWrites
  • LongWrites
  • ShortWrites
  • StringWrites
  • TemporalFormatter
  • UuidWrites

implicit object ByteWrites extends Writes[Byte]

Serializer for Byte types.

Source
Writes.scala
Linear Supertypes
Writes[Byte], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ByteWrites
  2. Writes
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def contramap[B](f: (B) => Byte): Writes[B]

    Returns a new instance that first converts a B value to a A one, before converting this A value into a JsValue.

    Returns a new instance that first converts a B value to a A one, before converting this A value into a JsValue.

    Definition Classes
    Writes
  2. def transform(transformer: Writes[JsValue]): Writes[Byte]

    Transforms the resulting JsValue using a Writes[JsValue].

    Transforms the resulting JsValue using a Writes[JsValue].

    Definition Classes
    Writes
  3. def transform(transformer: (JsValue) => JsValue): Writes[Byte]

    Transforms the resulting JsValue using transformer function.

    Transforms the resulting JsValue using transformer function.

    Definition Classes
    Writes
  4. def writes(o: Byte): JsNumber

    Converts the A value into a JsValue.

    Converts the A value into a JsValue.

    Definition Classes
    ByteWritesWrites