Trait/Object

reactivemongo.play.json.compat

HandlerConverters

Related Docs: object HandlerConverters | package compat

Permalink

trait HandlerConverters extends LowPriorityHandlerConverters1

Implicit conversions for handler types between play.api.libs.json and reactivemongo.api.bson .

import reactivemongo.play.json.compat.HandlerConverters._

def foo[T](jw: play.api.libs.json.OWrites[T]) = {
  val w: reactivemongo.api.bson.BSONDocumentWriter[T] = jw
  w
}

def bar[T](br: reactivemongo.api.bson.BSONReader[T]) = {
  val r: play.api.libs.json.Reads[T] = br
  r
}

Note: Logger reactivemongo.api.play.json.HandlerConverters can be used to debug.

Linear Supertypes
LowPriorityHandlerConverters1, LowPriorityHandlerConverters2, LowPriorityHandlerConverters3, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HandlerConverters
  2. LowPriorityHandlerConverters1
  3. LowPriorityHandlerConverters2
  4. LowPriorityHandlerConverters3
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to any2stringadd[HandlerConverters] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (HandlerConverters, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to ArrowAssoc[HandlerConverters] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (HandlerConverters) ⇒ Boolean, msg: ⇒ Any): HandlerConverters

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to Ensuring[HandlerConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (HandlerConverters) ⇒ Boolean): HandlerConverters

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to Ensuring[HandlerConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): HandlerConverters

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to Ensuring[HandlerConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): HandlerConverters

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to Ensuring[HandlerConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to StringFormat[HandlerConverters] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. implicit final def fromDocumentHandler[T](h: BSONDocumentHandler[T]): OFormat[T]

    Permalink

    Implicit conversion from new BSONDocumentHandler to Play JSON.

    Implicit conversion from new BSONDocumentHandler to Play JSON.

    import reactivemongo.play.json.compat.HandlerConverters.fromDocumentHandler
    
    def bar[T](bh: reactivemongo.api.bson.BSONDocumentHandler[T]) = {
      val h: play.api.libs.json.OFormat[T] = bh
      h
    }
  17. implicit final def fromDocumentWriter[T](w: BSONDocumentWriter[T]): OWrites[T]

    Permalink

    import reactivemongo.play.json.compat.HandlerConverters.fromDocumentWriter
    
    def bar[T](lw: reactivemongo.api.bson.BSONDocumentWriter[T]) = {
      val w: play.api.libs.json.OWrites[T] = lw
      w
    }
    Definition Classes
    LowPriorityHandlerConverters2
  18. implicit final def fromHandler[T](h: BSONHandler[T]): Format[T]

    Permalink
    Definition Classes
    LowPriorityHandlerConverters1
  19. implicit final def fromReader[T](implicit r: BSONReader[T]): Reads[T]

    Permalink

    Provided there is a BSON reader, a JSON one is resolved.

    Provided there is a BSON reader, a JSON one is resolved.

    import play.api.libs.json.Reads
    import reactivemongo.api.bson.BSONReader
    import reactivemongo.play.json.compat.fromReader
    
    def foo[T: BSONReader]: Reads[T] = implicitly[Reads[T]]
    Definition Classes
    LowPriorityHandlerConverters3
  20. implicit final def fromReaderConv[T](r: BSONReader[T]): Reads[T]

    Permalink
    Definition Classes
    LowPriorityHandlerConverters3
  21. implicit final def fromWriterConv[T](w: BSONWriter[T]): Writes[T]

    Permalink
    Definition Classes
    LowPriorityHandlerConverters3
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  25. implicit def jsonReaderNewValue[B <: BSONValue, L](implicit r: BSONReader[B], conv: (B) ⇒ L): Reads[L]

    Permalink

    Based on the compatibility conversions, provides instances of Play JSON Reads for the new BSON value API.

  26. implicit def jsonWriterNewDocument[L](implicit conv: (L) ⇒ BSONDocument): OWrites[L]

    Permalink

    Based on the compatibility conversions, provides instances of Play JSON OWrites for the new BSON value API.

  27. implicit def jsonWriterNewValue[B <: BSONValue, L](implicit conv: (L) ⇒ B): Writes[L]

    Permalink

    Based on the compatibility conversions, provides instances of Play JSON Writes for the new BSON value API.

    Based on the compatibility conversions, provides instances of Play JSON Writes for the new BSON value API.

    import play.api.libs.json.Writes
    import reactivemongo.api.bson.BSONObjectID
    import reactivemongo.play.json.compat.jsonWriterNewValue
    
    val w = implicitly[Writes[BSONObjectID]]
    Definition Classes
    LowPriorityHandlerConverters1
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. implicit final def toDocumentHandler[T](h: OFormat[T]): BSONDocumentHandler[T]

    Permalink

    Implicit conversion from Play JSON OFormat to the BSON API.

    Implicit conversion from Play JSON OFormat to the BSON API.

    import reactivemongo.play.json.compat.HandlerConverters.toDocumentHandler
    
    def foo[T](jh: play.api.libs.json.OFormat[T]) = {
      val h: reactivemongo.api.bson.BSONDocumentHandler[T] = jh
      h
    }
  33. final def toDocumentReaderConv[T](r: Reads[T]): BSONDocumentReader[T]

    Permalink

    Raises a JsError is the JSON value is not a JsObject.

    Raises a JsError is the JSON value is not a JsObject.

    import reactivemongo.play.json.compat.toDocumentReaderConv
    
    def lorem[T](jr: play.api.libs.json.Reads[T]) =
      toDocumentReaderConv(jr)
    Definition Classes
    LowPriorityHandlerConverters3
  34. implicit final def toDocumentWriter[T](implicit w: OWrites[T]): BSONDocumentWriter[T]

    Permalink

    Provided there is a Play JSON OWrites, resolve a document writer.

    Provided there is a Play JSON OWrites, resolve a document writer.

    import play.api.libs.json.OWrites
    import reactivemongo.api.bson.BSONDocumentWriter
    import reactivemongo.play.json.compat.toDocumentWriter
    
    def foo[T : OWrites]: BSONDocumentWriter[T] =
      implicitly[BSONDocumentWriter[T]]
    Definition Classes
    LowPriorityHandlerConverters2
    See also

    toDocumentWriterConv

  35. implicit final def toDocumentWriterConv[T](w: OWrites[T]): BSONDocumentWriter[T]

    Permalink

    import reactivemongo.play.json.compat.HandlerConverters.toDocumentWriterConv
    
    def foo[T](jw: play.api.libs.json.OWrites[T]) = {
      val w: reactivemongo.api.bson.BSONDocumentWriter[T] = jw
      w
    }
    Definition Classes
    LowPriorityHandlerConverters2
  36. implicit final def toHandler[T](h: Format[T]): BSONHandler[T]

    Permalink
    Definition Classes
    LowPriorityHandlerConverters1
  37. implicit final def toReader[T](implicit r: Reads[T]): BSONReader[T]

    Permalink

    Provided there is a Play JSON Reads, resolve a BSON reader.

    Provided there is a Play JSON Reads, resolve a BSON reader.

    import play.api.libs.json.Reads
    import reactivemongo.api.bson.BSONReader
    import reactivemongo.play.json.compat.toReader
    
    def foo[T: Reads]: BSONReader[T] = implicitly[BSONReader[T]]
    Definition Classes
    LowPriorityHandlerConverters2
    See also

    toDocumentWriterConv

  38. implicit final def toReaderConv[T](r: Reads[T]): BSONReader[T]

    Permalink

    Converts a Play JSON Reads to a BSON reader.

    Converts a Play JSON Reads to a BSON reader.

    import play.api.libs.json.Reads
    import reactivemongo.api.bson.BSONReader
    import reactivemongo.play.json.compat.toReaderConv
    
    def foo[T](implicit r: Reads[T]): BSONReader[T] = r
    Definition Classes
    LowPriorityHandlerConverters2
    See also

    toDocumentWriterConv

  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. implicit final def toWriter[T](w: Writes[T]): BSONWriter[T]

    Permalink
    Definition Classes
    LowPriorityHandlerConverters3
  41. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. def [B](y: B): (HandlerConverters, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from HandlerConverters to ArrowAssoc[HandlerConverters] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from LowPriorityHandlerConverters1

Inherited from LowPriorityHandlerConverters2

Inherited from LowPriorityHandlerConverters3

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from HandlerConverters to any2stringadd[HandlerConverters]

Inherited by implicit conversion StringFormat from HandlerConverters to StringFormat[HandlerConverters]

Inherited by implicit conversion Ensuring from HandlerConverters to Ensuring[HandlerConverters]

Inherited by implicit conversion ArrowAssoc from HandlerConverters to ArrowAssoc[HandlerConverters]

Ungrouped