title: JavaEE way to serialize object to json
body: <p>With Jackson i can create Json strings very easily:</p>
  
  <pre><code>String json = new ObjectMapper().writeValueAsString(object)
  </code></pre>
  
  <p>The problem is that this relies on specific api implementation. Is there a pure JavaEE way to achieve this?</p>
  
  <p>I want to send the json via websocket. Sending via rest is no problem - specifying the mediatype is enough. Probably there is a way to create the json the same way the rest api does it.</p>