Packages

t

play.api.libs.json

JsMacrosWithOptions

trait JsMacrosWithOptions[Opts <: MacroOptions] extends JsMacros

Source
JsMacros.scala
Linear Supertypes
JsMacros, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsMacrosWithOptions
  2. JsMacros
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. macro def format[A]: OFormat[A]

    Creates a OFormat[T] by resolving, at compile-time, the case class fields or sealed family, and the required implicits.

    Creates a OFormat[T] by resolving, at compile-time, the case class fields or sealed family, and the required implicits.

    $macroWarning

    $macroTypeParam

    import play.api.libs.functional.syntax._
    import play.api.libs.json.{ Json, JsonConfiguration, __ }
    
    case class User(userName: String, age: Int)
    
    val userFormat1 = Json.format[User]
    // macro-compiler replaces Json.format[User] by injecting into compile chain
    // the exact code you would write yourself. This is strictly equivalent to:
    val userFormat2 = (
       (__ \ implicitly[JsonConfiguration].naming("userName")).format[String] and
       (__ \ implicitly[JsonConfiguration].naming("age")).format[Int]
    )(User.apply, unlift(User.unapply))
    Definition Classes
    JsMacrosWithOptions → JsMacros
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. macro def reads[A]: Reads[A]

    Creates a Reads[T] by resolving, at compile-time, the case class fields or sealed family, and the required implicits.

    Creates a Reads[T] by resolving, at compile-time, the case class fields or sealed family, and the required implicits.

    $macroWarning

    $macroTypeParam

    import play.api.libs.json.{ Json, Reads }
    
    case class User(userName: String, age: Int)
    
    implicit val userReads: Reads[User] =
      Json.using[Json.MacroOptions with Json.DefaultValues].reads[User]
    Definition Classes
    JsMacrosWithOptions → JsMacros
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. macro def writes[A]: OWrites[A]

    Creates a OWrites[T] by resolving, at compile-time, the case class fields or sealed family, and the required implicits.

    Creates a OWrites[T] by resolving, at compile-time, the case class fields or sealed family, and the required implicits.

    $macroWarning

    $macroTypeParam

    import play.api.libs.functional.syntax._
    import play.api.libs.json.{ Json, JsonConfiguration, __ }
    
    case class User(userName: String, age: Int)
    
    implicit val userWrites1 = Json.writes[User]
    // macro-compiler replaces Json.writes[User] by injecting into compile chain
    // the exact code you would write yourself. This is strictly equivalent to:
    implicit val userWrites2 = (
       (__ \ implicitly[JsonConfiguration].naming("userName")).write[String] and
       (__ \ implicitly[JsonConfiguration].naming("age")).write[Int]
    )(unlift(User.unapply))
    Definition Classes
    JsMacrosWithOptions → JsMacros

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from JsMacros

Inherited from AnyRef

Inherited from Any

Ungrouped