play.api.libs.json

JsPath

object JsPath extends JsPath

Source
JsPath.scala
Linear Supertypes
JsPath, Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JsPath
  2. JsPath
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++(other: JsPath): JsPath

    Definition Classes
    JsPath
  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. def \(child: Symbol): JsPath

    Definition Classes
    JsPath
  8. def \(child: String): JsPath

    Definition Classes
    JsPath
  9. def \\(child: Symbol): JsPath

    Definition Classes
    JsPath
  10. def \\(child: String): JsPath

    Definition Classes
    JsPath
  11. def apply(json: JsValue): List[JsValue]

    Definition Classes
    JsPath
  12. def apply(idx: Int): JsPath

    Definition Classes
    JsPath
  13. def applyTillLast(json: JsValue): Either[JsError, JsResult[JsValue]]

    Definition Classes
    JsPath
  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def asSingleJsResult(json: JsValue): JsResult[JsValue]

    Definition Classes
    JsPath
  16. def asSingleJson(json: JsValue): JsValue

    Definition Classes
    JsPath
  17. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def compose(other: JsPath): JsPath

    Definition Classes
    JsPath
  19. def createObj(pathValues: (JsPath, JsValue)*): JsObject

  20. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def format[T](w: Writes[T])(implicit r: Reads[T]): OFormat[T]

    Reads/Writes a T at JsPath using provided explicit Writes[T] and implicit Reads[T]

    Reads/Writes a T at JsPath using provided explicit Writes[T] and implicit Reads[T]

    Definition Classes
    JsPath
  23. def format[T](r: Reads[T])(implicit w: Writes[T]): OFormat[T]

    Reads/Writes a T at JsPath using provided explicit Reads[T] and implicit Writes[T]

    Reads/Writes a T at JsPath using provided explicit Reads[T] and implicit Writes[T]

    Definition Classes
    JsPath
  24. def format[T](implicit f: Format[T]): OFormat[T]

    Reads/Writes a T at JsPath using provided implicit Format[T]

    Reads/Writes a T at JsPath using provided implicit Format[T]

    Definition Classes
    JsPath
  25. def formatNullable[T](implicit f: Format[T]): OFormat[Option[T]]

    Reads/Writes a Option[T] (optional or nullable field) at given JsPath

    Reads/Writes a Option[T] (optional or nullable field) at given JsPath

    Definition Classes
    JsPath
    See also

    JsPath.writeNullable to see behavior in writes

    JsPath.readNullable to see behavior in reads

  26. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. object json

    Definition Classes
    JsPath
  29. def lazyFormat[T](r: ⇒ Reads[T], w: ⇒ Writes[T]): OFormat[T]

    Lazy Reads/Writes a T at given JsPath using explicit Reads[T] and Writes[T] (useful in case of recursive case classes).

    Lazy Reads/Writes a T at given JsPath using explicit Reads[T] and Writes[T] (useful in case of recursive case classes).

    Definition Classes
    JsPath
    See also

    JsPath.lazyWriteNullable to see behavior in writes

    JsPath.lazyReadNullable to see behavior in reads

  30. def lazyFormat[T](f: ⇒ Format[T]): OFormat[T]

    Lazy Reads/Writes a T at given JsPath using implicit Format[T] (useful in case of recursive case classes).

    Lazy Reads/Writes a T at given JsPath using implicit Format[T] (useful in case of recursive case classes).

    Definition Classes
    JsPath
    See also

    JsPath.lazyWriteNullable to see behavior in writes

    JsPath.lazyReadNullable to see behavior in reads

  31. def lazyFormatNullable[T](r: ⇒ Reads[T], w: ⇒ Writes[T]): OFormat[Option[T]]

    Lazy Reads/Writes a Option[T] (optional or nullable field) at given JsPath using explicit Reads[T] and Writes[T] (useful in case of recursive case classes).

    Lazy Reads/Writes a Option[T] (optional or nullable field) at given JsPath using explicit Reads[T] and Writes[T] (useful in case of recursive case classes).

    Definition Classes
    JsPath
    See also

    JsPath.lazyWriteNullable to see behavior in writes

    JsPath.lazyReadNullable to see behavior in reads

  32. def lazyFormatNullable[T](f: ⇒ Format[T]): OFormat[Option[T]]

    Lazy Reads/Writes a Option[T] (optional or nullable field) at given JsPath using implicit Format[T] (useful in case of recursive case classes).

    Lazy Reads/Writes a Option[T] (optional or nullable field) at given JsPath using implicit Format[T] (useful in case of recursive case classes).

    Definition Classes
    JsPath
    See also

    JsPath.lazyWriteNullable to see behavior in writes

    JsPath.lazyReadNullable to see behavior in reads

  33. def lazyRead[T](r: ⇒ Reads[T]): Reads[T]

    Reads a T at JsPath using the explicit Reads[T] passed by name which is useful in case of recursive case classes for ex.

    Reads a T at JsPath using the explicit Reads[T] passed by name which is useful in case of recursive case classes for ex.

    case class User(id: Long, name: String, friend: User)
    
    implicit lazy val UserReads: Reads[User] = (
      (__ \ 'id).read[Long] and
      (__ \ 'name).read[String] and
      (__ \ 'friend).lazyRead(UserReads)
    )(User.apply _)
    Definition Classes
    JsPath
  34. def lazyReadNullable[T](r: ⇒ Reads[T]): Reads[Option[T]]

    Reads lazily a Option[T] search optional or nullable field at JsPath using the explicit Reads[T] passed by name which is useful in case of recursive case classes for ex.

    Reads lazily a Option[T] search optional or nullable field at JsPath using the explicit Reads[T] passed by name which is useful in case of recursive case classes for ex.

    case class User(id: Long, name: String, friend: Option[User])
    
    implicit lazy val UserReads: Reads[User] = (
      (__ \ 'id).read[Long] and
      (__ \ 'name).read[String] and
      (__ \ 'friend).lazyReadNullable(UserReads)
    )(User.apply _)
    Definition Classes
    JsPath
  35. def lazyWrite[T](w: ⇒ Writes[T]): OWrites[T]

    Writes a T at JsPath using the explicit Writes[T] passed by name which is useful in case of recursive case classes for ex

    Writes a T at JsPath using the explicit Writes[T] passed by name which is useful in case of recursive case classes for ex

    case class User(id: Long, name: String, friend: User)
    
    implicit lazy val UserReads: Reads[User] = (
      (__ \ 'id).write[Long] and
      (__ \ 'name).write[String] and
      (__ \ 'friend).lazyWrite(UserReads)
    )(User.apply _)
    Definition Classes
    JsPath
  36. def lazyWriteNullable[T](w: ⇒ Writes[T]): OWrites[Option[T]]

    Writes a Option[T] at JsPath using the explicit Writes[T] passed by name which is useful in case of recursive case classes for ex

    Writes a Option[T] at JsPath using the explicit Writes[T] passed by name which is useful in case of recursive case classes for ex

    Please note that it's not writeOpt to be coherent with readNullable

    case class User(id: Long, name: String, friend: Option[User])
    
    implicit lazy val UserReads: Reads[User] = (
      (__ \ 'id).write[Long] and
      (__ \ 'name).write[String] and
      (__ \ 'friend).lazyWriteNullable(UserReads)
    )(User.apply _)
    Definition Classes
    JsPath
  37. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  38. final def notify(): Unit

    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  40. val path: List[PathNode]

    Definition Classes
    JsPath
  41. def prune(js: JsValue): JsResult[JsObject]

    Simple Prune for simple path and only JsObject

    Simple Prune for simple path and only JsObject

    Definition Classes
    JsPath
  42. def read[T](t: T): Reads[T]

    Pure Reads doesn't read anything but creates a JsObject based on JsPath with the given T value

    Pure Reads doesn't read anything but creates a JsObject based on JsPath with the given T value

    Definition Classes
    JsPath
  43. def read[T](implicit r: Reads[T]): Reads[T]

    Reads a T at JsPath

    Reads a T at JsPath

    Definition Classes
    JsPath
  44. def readNullable[T](implicit r: Reads[T]): Reads[Option[T]]

    Reads a Option[T] search optional or nullable field at JsPath (field not found or null is None and other cases are Error).

    Reads a Option[T] search optional or nullable field at JsPath (field not found or null is None and other cases are Error).

    It runs through JsValue following all JsPath nodes on JsValue except last node: - If one node in JsPath is not found before last node => returns JsError( "missing-path" ) - If all nodes are found till last node, it runs through JsValue with last node =>

    • If last node is not found => returns None
    • If last node is found with value "null" => returns None
    • If last node is found => applies implicit Reads[T]
    Definition Classes
    JsPath
  45. def rw[T](implicit r: Reads[T], w: Writes[T]): OFormat[T]

    Reads/Writes a T at JsPath using provided implicit Reads[T] and Writes[T]

    Reads/Writes a T at JsPath using provided implicit Reads[T] and Writes[T]

    Please note we couldn't call it "format" to prevent conflicts

    Definition Classes
    JsPath
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. def toJsonString: String

    Definition Classes
    JsPath
  48. def toString(): String

    Definition Classes
    JsPath → AnyRef → Any
  49. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. def write[T](t: T)(implicit w: Writes[T]): OWrites[JsValue]

    Writes a pure value at given JsPath

    Writes a pure value at given JsPath

    Definition Classes
    JsPath
  53. def write[T](implicit w: Writes[T]): OWrites[T]

    Writes a T at given JsPath

    Writes a T at given JsPath

    Definition Classes
    JsPath
  54. def writeNullable[T](implicit w: Writes[T]): OWrites[Option[T]]

    Writes a Option[T] at given JsPath If None => doesn't write the field (never writes null actually) else => writes the field using implicit Writes[T]

    Writes a Option[T] at given JsPath If None => doesn't write the field (never writes null actually) else => writes the field using implicit Writes[T]

    Definition Classes
    JsPath

Deprecated Value Members

  1. def formatOpt[T](implicit f: Format[T]): OFormat[Option[T]]

    Reads/Writes a Option[T] at given JsPath

    Reads/Writes a Option[T] at given JsPath

    Definition Classes
    JsPath
    Annotations
    @deprecated
    Deprecated

    (Since version 2.1-RC2) use formatNullable[T] instead (in parallel with readNullable)

    See also

    JsPath.writeOpt to see behavior in writes

    JsPath.readOpt to see behavior in reads

  2. def readOpt[T](implicit r: Reads[T]): Reads[Option[T]]

    Reads optional field at JsPath.

    Reads optional field at JsPath. If JsPath is not found => None If JsPath is found => applies implicit Reads[T]

    Definition Classes
    JsPath
    Annotations
    @deprecated
    Deprecated

    (Since version 2.1-RC2) use readNullable[T] instead (which manages both missing and null fields)

  3. def writeOpt[T](implicit w: Writes[T]): OWrites[Option[T]]

    Writes a Option[T] at given JsPath If None => doesn't write the field else => writes the field using implicit Writes[T]

    Writes a Option[T] at given JsPath If None => doesn't write the field else => writes the field using implicit Writes[T]

    Definition Classes
    JsPath
    Annotations
    @deprecated
    Deprecated

    (Since version 2.1-RC2) use writeNullable[T] instead (in parallel with readNullable)

Inherited from JsPath

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped