title: Play 2.2 match if there exists an implicit Json converter
body: <p>I have put all my Json converters in one file JsonUtil, and then have a convertToJson method which tries to convert any object passed to json.</p>
  
  <p>Basically a structure like this:</p>
  
  <pre><code>implicit val format_A = format[A]
  implicit val format_B = format[B]
  
  def convertToJson(o: Any): JsValue =
    o match {
      case a: A =&gt; Json.toJson(a)
      case b: B =&gt; Json.toJson(b)
      case a: Any =&gt; Logger.warn("could not convert to json: "+a); JsNull
    }
  </code></pre>
  
  <p>but with alot more formatters / cases. I don't want to import all these implicits when I need conversions (for various reasons). Is there a way to match if there exists a valid toJson conversion, so I wouldn't have to write all the cases?</p>
  
  <p>like:</p>
  
  <pre><code>case o: ExistJsonConversion =&gt; Json.toJson(o)
  </code></pre>